Date: 09/03/99
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #2230 Updated: latest CVS breaks Informix driver "connection id""
- Previous message: Darren Seifert: "[PHP-DEV] Re: Bug #1741 Updated: httpd core dump"
- In reply to: David Sklar: "Re: [PHP-DEV] 3.0.12: mysql_store_result in php3_mysql_query"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 18:11 03/09/99 , David Sklar wrote:
> > > > > 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.
That's a good idea, except I don't think mysql_errno() would be any good in
that case - we'd have to use mysql_num_fields() as they suggest
(mysql_errno(), at least in old MySQL versions, only reported connection
problems, not query 'runtime' problems).
I'll commit fixes to the PHP 3.0 tree soon.
Zeev
-- Zeev Suraski <zeev <email protected>> http://www.zend.com/ For a PGP public key, finger bourbon <email protected>-- 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: Bug Database: "[PHP-DEV] PHP 4.0 Bug #2230 Updated: latest CVS breaks Informix driver "connection id""
- Previous message: Darren Seifert: "[PHP-DEV] Re: Bug #1741 Updated: httpd core dump"
- In reply to: David Sklar: "Re: [PHP-DEV] 3.0.12: mysql_store_result in php3_mysql_query"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

