]> granicus.if.org Git - php/commitdiff
have DB::isError return true if passed "null". Now you can more consistently
authorChuck Hagenbuch <chagenbu@php.net>
Fri, 26 Jan 2001 20:07:22 +0000 (20:07 +0000)
committerChuck Hagenbuch <chagenbu@php.net>
Fri, 26 Jan 2001 20:07:22 +0000 (20:07 +0000)
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.

pear/DB.php

index 788aed02fc803f609cc595485510fe950aa72e4b..3c706c0aac3dedc54af4f2f5018ed5285bc53e16 100644 (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));
     }
 
     /**