Hi,
Not sure if this is related to PHP or mysql so please move if you think it is the latter.
I've been using stored procedure within php for a while now and am fairly used to the syntax. However I've got a interesting problem at the moment that I'm not sure how to rectify.
I've got a stored procedure that is return a result set that I am then passing to mysql_fetch_array();
i.e. in the format (select id,name FROM table ORDER by name);
If I go to the page in question that should display this result set, I receive the following error
mysql_fetch_array(): supplied argument is not a valid MySQL result resource
Then if I refresh the page and refresh it again whilst it is refreshing, it shows the correct output. A single refresh on its own shows the error. This has me really stumped and I'm not quite sure how to go about debugging the problem. I've tried clearing my cache, using different browsers and ctrl-f5 instead of just f5.
Just as a quick test I've even replaced the sproc call to an inline mysql_query statement and am getting the same issue!
Does anyone have any clues what's going on here? I know there are some issue with mysql sproc calls, but when doing it as inline sql I don't know why I'm getting an issue? There is no such problem in the command line which is what leads me to believe it's a php bug.
Thanks