chagenbu Fri Jan 26 12:07:23 2001 EDT
Modified files:
/php4/pear DB.php
/php4/pear/DB mysql.php
Log:
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.
Index: php4/pear/DB.php
diff -u php4/pear/DB.php:1.43 php4/pear/DB.php:1.44
--- php4/pear/DB.php:1.43 Tue Jan 9 17:01:52 2001
+++ php4/pear/DB.php Fri Jan 26 12:07:22 2001
@@ -17,7 +17,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: DB.php,v 1.43 2001/01/10 01:01:52 ssb Exp $
+// $Id: DB.php,v 1.44 2001/01/26 20:07:22 chagenbu Exp $
//
// Database independent query interface.
//
@@ -242,9 +242,10 @@
*/
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));
}
/**
Index: php4/pear/DB/mysql.php
diff -u php4/pear/DB/mysql.php:1.44 php4/pear/DB/mysql.php:1.45
--- php4/pear/DB/mysql.php:1.44 Tue Jan 9 17:01:53 2001
+++ php4/pear/DB/mysql.php Fri Jan 26 12:07:23 2001
@@ -205,9 +205,9 @@
$errno = mysql_errno($this->connection);
if (!$errno) {
- return NULL;
+ return $this->raiseError('end of results');
}
-
+
return $this->mysqlRaiseError($errno);
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]