mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02: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:
parent
a06f392ae4
commit
b4378dcf80
1 changed files with 4 additions and 3 deletions
|
@ -242,9 +242,10 @@ class DB
|
||||||
*/
|
*/
|
||||||
function isError($value)
|
function isError($value)
|
||||||
{
|
{
|
||||||
return is_object($value) &&
|
return (is_object($value) &&
|
||||||
(get_class($value) == "db_error" ||
|
(get_class($value) == "db_error" ||
|
||||||
is_subclass_of($value, "db_error"));
|
is_subclass_of($value, "db_error")) ||
|
||||||
|
!isset($value));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue