Re: 3.0.12: mysql_store_result in php3_mysql_query

From: Date: Fri, 03 Sep 1999 16:11:24 +0000
Subject: Re: 3.0.12: mysql_store_result in php3_mysql_query
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-10516@lists.php.net to get a copy of this message
> > > > Why is it returning true if there was an error? mysql_store_result() > > > returns > > > > NULL if an error occurs. > > > > Actually no, mysql_store_result() returns NULL in many cases. You may call > > them errors, but from our point of view, they aren't. > > David, did you actually step through the code to verify that > mysql_store_result() is returning NULL on your SELECT query? If it is, > then I agree with you that there is a problem, otherwise, Zeev is right, > the NULL return is likely valid. I didn't step through the code - the problem happens very intermittently, it first occurred a few days ago and has happened three or four times since then, but this page is accessed once every 5 minutes on multiple servers and has been for months, with no errors. This makes me guess that perhaps something happens to the tcpip connection to MySQL which causes an error (due to some issue on the database server). Zeev, what do you think of a patch along the lines of changing the mysql_store_result return value check to something like this: if ((mysql_result=mysql_store_result(mysql))==NULL) { if (mysql_errno(mysql)) { php3_error(E_WARNING,"Unable to save MySQL query result"); RETURN_FALSE; } else { RETURN_TRUE; } } This is similar to what's recommended in the "Why is it that after mysql_query() returns success, mysql_store_result() sometimes returns NULL?" section of the mysql manual. -dave

« previous php.dev (#10516) next »