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:
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user