DB::isError() -- Determines if a variable is a DB_Error object ïÐÉÓÁÎÉÅ
Checks whether a result code from a DB method is a
DB_Error object or not.
ðÁÒÁÍÅÔÒ
- mixed
$value
Variable to check
÷ÏÚ×ÒÁÝÁÅÍÏÅ ÚÎÁÞÅÎÉÅ
boolean - TRUE if $value
is a DB_Error object
úÁÍÅÔËÁüÔÁ ÆÕÎËÃÉÑ ÄÏÌÖÎÁ ×ÙÚÙ×ÁÔØÓÑ ÓÔÁÔÉÞÅÓËÉ. ðÒÉÍÅÒПример 22-1. Using isError()
<?php
require_once 'DB.php';
$db =& DB::connect('pgsql://usr:pw@localhost/dbnam');
if (DB::isError($db)) {
die($db->getMessage());
}
?>
|
|
|