Re: Best way to figure out whether a query returns RESULT or NON-RESULT

From: Date: Sat, 16 Oct 2004 10:30:31 +0000
Subject: Re: Best way to figure out whether a query returns RESULT or NON-RESULT
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-199630@lists.php.net to get a copy of this message
Karam Chand wrote:
Hello, mysql_query() returns non-false even if there was an UPDATE statement and the query was successful. But if I put the $result variable in mysql_num_rows() it returns an error, $result in invalid handle. I was asking how to know that where its an UPDATE statement so I dont call mysql_num_rows() at all.
I Chris said, if($result === true || $result === false), no rows were returned.

« previous php.general (#199630) next »