DB::isError() – Determines if a variable is a DB_Error object


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().


mixed $value

Variable to check

Return value

boolean - TRUE if $value is a DB_Error object


This function should be called statically.


Using isError()

require_once 'DB.php';

$db =& DB::connect('pgsql://usr:pw@localhost/dbnam');
if (
PEAR::isError($db)) {
Connects to a database (Previous) Interface for database access (Next)
Last updated: Wed, 18 Jan 2017 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.