1
0
mirror of https://github.com/php/php-src.git synced 2026-03-28 18:22:42 +01:00

have DB::isError return true if passed "null". Now you can more consistently

use DB::isError(), since some of the db drivers return nulls from various
functions (like fetchRow()), and others don't... We should probably make all
of them just return errors. I did this for the mysql driver, as a start.
This commit is contained in:
Chuck Hagenbuch
2001-01-26 20:07:22 +00:00
parent a06f392ae4
commit b4378dcf80

View File

@@ -242,9 +242,10 @@ class DB
*/
function isError($value)
{
return is_object($value) &&
(get_class($value) == "db_error" ||
is_subclass_of($value, "db_error"));
return (is_object($value) &&
(get_class($value) == "db_error" ||
is_subclass_of($value, "db_error")) ||
!isset($value));
}
/**