previousDB::connect() (Previous) (Next) DB_commonnext

View this page in Last updated: Sun, 05 Jul 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

DB::isError()

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

Synopsis

boolean isError ( mixed $value )

Description

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

Parameter

mixed $value

Variable to check

Return value

boolean - TRUE if $value is a DB_Error object

Note

This function should be called statically.

Example

Using isError()

<?php
require_once 'DB.php';

$db =& DB::connect('pgsql://usr:pw@localhost/dbnam');
if (
PEAR::isError($db)) {
    die(
$db->getMessage());
}
?>
previousDB::connect() (Previous) (Next) DB_commonnext

Download Documentation Last updated: Sun, 05 Jul 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.