Re: Supplied argument is not a valid MySQL result

From: Date: Mon, 17 Jun 2002 18:52:44 +0000
Subject: Re: Supplied argument is not a valid MySQL result
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-19849@lists.php.net to get a copy of this message
Hello!! have you tried to echo $password, or $username?!?! See if those variable are even populated... See if MYSQL is even running... Dan On Monday, June 17, 2002, at 12:00 PM, damiano@webartonline.com wrote:
Hi, Coming back after a weekend out of town, I noticed that the server of one of my clients was having problems with mySQL. All the scripts that were connecting to a db would return an error like the following: Supplied argument is not a valid MySQL result in (then the line of the script that failed) I then tried to check the db using phpMyAdmin (which was an older version, 2.2.0) and noticed that apparently all the databases were empty. I would also get errors when trying to create new db/tables. I then uploaded a newer version of phpMyAdmin (2.2.6) in another folder, and I could see all the tables and the information they contained, again. However, all the scripts that previously worked keep giving me the same error, that the supplied argument is not a valid MySQL result. A typical script that would cause this problem was like this: <? mysql_select_db(strtolower($username)) or die("Could not select database."); $query = mysql_query("SELECT * FROM users WHERE Password='$password'"); $matches = mysql_num_rows($query); ?> Similar scripts with different queries return an error at the same point, while trying to access the results returned by a query. I even tried replacing the above query with "SELECT COUNT(*) FROM users etc.", not to avail. What could have caused this problem? The server is running Windows NT, PHP is 4.1.0 and MySQL is 3.23. Any help would be greatly appreciated. Damiano -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.db (#19849) next »