Date: 09/02/99
- Next message: pan <email protected>: "[PHP-DEV] PHP 4.0 Bug #2226: Will not work with MySQL and MacOSX"
- Previous message: Mark Musone: "[PHP-DEV] cvs: /php3/functions php3_mcal.c php3_mcal.h"
- Next in thread: Rasmus Lerdorf: "Re: [PHP-DEV] 3.0.12: mysql_store_result in php3_mysql_query"
- Reply: Rasmus Lerdorf: "Re: [PHP-DEV] 3.0.12: mysql_store_result in php3_mysql_query"
- Maybe reply: Zeev Suraski: "Re: [PHP-DEV] 3.0.12: mysql_store_result in php3_mysql_query"
- Maybe reply: David Sklar: "Re: [PHP-DEV] 3.0.12: mysql_store_result in php3_mysql_query"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I have a page that does:
$r = mysql_query('select ping from ping');
if ($r) {
if ($ob = mysql_fetch_object($r)) {
echo $ob->ping."\n";
} else {
echo "Can't get ob\n";
}
} else {
echo "Can't do query\n";
}
Very infrequently, when accessing this page, I get a "PHP 3 Warning: 1 is not
a MySQL result index" at the line with mysql_fetch_object(). So mysql_query is
returning 1 (or TRUE that gets evaluated to 1?) but it's still not really a
result handle.
Could the following code in php3_mysql_query() be responsible: ?
if ((mysql_result=mysql_store_result(mysql))==NULL) {
/*php3_error(E_WARNING,"Unable to save MySQL query result");
RETURN_FALSE;
*/
RETURN_TRUE;
}
Why is it returning true if there was an error? mysql_store_result() returns
NULL if an error occurs.
-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: pan <email protected>: "[PHP-DEV] PHP 4.0 Bug #2226: Will not work with MySQL and MacOSX"
- Previous message: Mark Musone: "[PHP-DEV] cvs: /php3/functions php3_mcal.c php3_mcal.h"
- Next in thread: Rasmus Lerdorf: "Re: [PHP-DEV] 3.0.12: mysql_store_result in php3_mysql_query"
- Reply: Rasmus Lerdorf: "Re: [PHP-DEV] 3.0.12: mysql_store_result in php3_mysql_query"
- Maybe reply: Zeev Suraski: "Re: [PHP-DEV] 3.0.12: mysql_store_result in php3_mysql_query"
- Maybe reply: David Sklar: "Re: [PHP-DEV] 3.0.12: mysql_store_result in php3_mysql_query"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

