Re: mysql_query returning empty result after DELETE

From: Date: Mon, 14 Sep 2009 22:55:38 +0000
Subject: Re: mysql_query returning empty result after DELETE
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-46502@lists.php.net to get a copy of this message
Stan wrote:
OK. If I change the test to "if(mysql_num_rows($thisRow) < 1)" it does what I want. I guess if I want to understand why False was returned originally (just after I created the database) I need to start over.
According to the docs mysql_query only returns false if there's an error.
Do I have 4 possible conditions here: 1) the mysql_query() function fails and I get a PHP error, 2) the query fails at the server and I get False, or 3) the query doesn't fail at the server and I get "a result" that a) is empty, or b) contains 1 or more rows? Yes.
1) I'm not sure what you mean. If you try to run a query before having a connection (or not checking the connection is valid before running a query), then mysql_query will return false and php will throw warnings or notices (can't remember which). 2) Correct 3) Also correct. -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.db (#46502) next »