kernelgpf Posted January 30, 2010 Share Posted January 30, 2010 This is a really weird problem. I copy and paste the query into phpmyadmin and it works, the mysql_error on the end of the query is not activated though I get the "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/arobyn7/public_html/agility/crons76021/30minutes.php on line 5" error. As I said, the query copied+pasted not only works in phpmyadmin but also returns rows. $query=mysql_query("select d.owner,d.energy,d.id,o.loggedintoday,d.hunger,d.age,d.accident from dogs as d,users as o where d.owner=o.id and o.loggedintoday='yes'")or die(mysql_error()); while($row=mysql_fetch_array($query)){ //stuff } Quote Link to comment https://forums.phpfreaks.com/topic/190369-mysql_fetch_array-error-mysql_error-not-being-activated-query-works-in-db/ Share on other sites More sharing options...
PFMaBiSmAd Posted January 30, 2010 Share Posted January 30, 2010 //stuff The stuff inside your loop is overwriting the $query variable that was the result resource from the first query. Be careful when reusing variables. Quote Link to comment https://forums.phpfreaks.com/topic/190369-mysql_fetch_array-error-mysql_error-not-being-activated-query-works-in-db/#findComment-1004270 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.