RE: [PHP-DB] PHP4 and mysql_fetch_array() - one more try

From: Date: Thu, 02 Nov 2000 16:06:14 +0000
Subject: RE: [PHP-DB] PHP4 and mysql_fetch_array() - one more try
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-4145@lists.php.net to get a copy of this message
> Well, I can't quite understand this, because it is not an error if a > SELECT query returns no rows! An error is, for example, if there would > be a syntax error in SQL statement, or a query on a non-existing table, > or something like this. I think PHP developers should have a look at > this issue... I might have missed something here, but PHP doesn't throw an error if the query returns no rows. As the FAQ states; "You are trying to use a result identifier that is 0. The 0 indicates that your query failed for some reason. You need to check for errors after submitting a query and before you attempt to use the returned result identifier." Which, as it says, means the QUERY has failed, so the result identifier is not receiving a valid query result. So, the failure could either be a failed connection or an invalid query. If you were checking for errors from the connection to the result, you would see where the error was occuring. I would go back and check the query syntax again and again, check the quotes and the syntax and put in some error checking. My 2p M@

« previous php.db (#4145) next »