Date: 09/03/99
- Next message: gorgo <email protected>: "[PHP-DEV] Bug #2233: mysql settings in php ini don't work"
- Previous message: Bug Database: "[PHP-DEV] Bug #1579 Updated: error_log acts like printf"
- Next in thread: Zeev Suraski: "Re: [PHP-DEV] 3.0.12: mysql_store_result in php3_mysql_query"
- Reply: Zeev Suraski: "Re: [PHP-DEV] 3.0.12: mysql_store_result in php3_mysql_query"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> > > > 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
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: gorgo <email protected>: "[PHP-DEV] Bug #2233: mysql settings in php ini don't work"
- Previous message: Bug Database: "[PHP-DEV] Bug #1579 Updated: error_log acts like printf"
- Next in thread: Zeev Suraski: "Re: [PHP-DEV] 3.0.12: mysql_store_result in php3_mysql_query"
- Reply: Zeev Suraski: "Re: [PHP-DEV] 3.0.12: mysql_store_result in php3_mysql_query"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

