Forum Moderators: coopster
Warning: mysql_num_rows(): supplied argument is not a valid MySQL
result resource in /home/groovyhi/public_html/control/index.php on line 142
If I go to my user list I see these 2 errors and I am not able to view
any user information or search through them:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL
result resource in /home/groovyhi/public_html/control/index.php on line 364
Warning: mysql_num_rows(): supplied argument is not a valid MySQL
result resource in /home/groovyhi/public_html/control/index.php on line 408
When I try to email my users I get this error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL
result resource in /home/groovyhi/public_html/control/index.php on line 835
So I basically can't do anything but approve sites right now. I can't
even fulfill the orders I received last night and today. :(
The previous owner of the exchange used to help me with these things but I can't seem to get in touch with him. I am afraid if I try to fix this myself I will make things worse. If someone can fix this for me I will give you my login information and a payment.
Thanks,
Ana
[edited by: ergophobe at 5:39 pm (utc) on Sep. 30, 2005]
[edit reason] no personal urls please as per usage agreement [/edit]
What's happening is that you are failing to return a result from a query, so no resource gets allocated... or you are using a variable that is not a resource for some other reason.
You need to verify that you're connecting to the database and sending a valid query. Since it has suddenly started happening in many places at once, I wonder whether you are getting denied access to the DB or at least to perform certain operations on the DB.
Try putting a test script on the server that does nothing but connect to the DB server and send a very simple query, using the same info that you are using to connect currently. So something like
$link = mysql_connect("hostname", "username", "password") or die("Could not connect to server: " . mysql_error());mysql_select_db("db_name", $link) or die("Could not select DB: " . mysql_error());
$result = mysql_query("SELECT * FROM tableName") or die("Query failed: " . mysql_error());
var_dump($result);
Of course, you need to replace hostname, username, password, db_name and tableName with whatever matches on your system.
Once you've done that, run that script and see how far it makes it. If everything is working right, it should ID result as a resource when it gets dumped. If not, it should fail at the first problem.