boolean isError (
mixed $value
)
Checks whether a result code from a DB method is a DB_Error object or not.
You're generally better off using PEAR::isError() instead of the DB specific isError().
$value
Variable to check
boolean - TRUE if $value
is a DB_Error object
This function should be called statically.
Using isError()
<?php
require_once 'DB.php';
$db =& DB::connect('pgsql://usr:pw@localhost/dbnam');
if (PEAR::isError($db)) {
die($db->getMessage());
}
?>