Connecting Tech Pros Worldwide Help | Site Map

ERROR: supplied argument is not a valid MySQL result

Member
 
Join Date: Sep 2007
Posts: 77
#1: Oct 15 '09
When I run my site from localhost, no error, but when I move it to
webhosting, it show below error, why?

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/asi50080/public_html/onlineadv/category.php on line 143

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/asi50080/public_html/onlineadv/category.php on line 155
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#2: Oct 15 '09

re: ERROR: supplied argument is not a valid MySQL result


you don’t check, whether mysql_query() doesn’t return an error?
TheServant's Avatar
Expert
 
Join Date: Feb 2008
Location: Australia
Posts: 913
#3: Oct 15 '09

re: ERROR: supplied argument is not a valid MySQL result


Just add a die statement after your query before your count or fetch:
Expand|Select|Wrap|Line Numbers
  1. mysql_query("...") or die(mysql_error());
That should show you why.
Reply