pdostatement.errorinfo(3) php man page | unix.com

Man Page: pdostatement.errorinfo

Operating Environment: php

Section: 3

PDOSTATEMENT.ERRORINFO(3)						 1						 PDOSTATEMENT.ERRORINFO(3)

PDOStatement::errorInfo - Fetch extended error information associated with the last operation on the statement handle

SYNOPSIS
public array PDOStatement::errorInfo (void )
DESCRIPTION
RETURN VALUES
PDOStatement.errorInfo(3) returns an array of error information about the last operation performed by this statement handle. The array con- sists of the following fields: +--------+---------------------------------------------------+ |Element | | | | | | | Information | | | | +--------+---------------------------------------------------+ | 0 | | | | | | | SQLSTATE error code (a five characters alphanu- | | | meric identifier defined in the ANSI SQL stan- | | | dard). | | | | | 1 | | | | | | | Driver specific error code. | | | | | 2 | | | | | | | Driver specific error message. | | | | +--------+---------------------------------------------------+
EXAMPLES
Example #1 Displaying errorInfo() fields for a PDO_ODBC connection to a DB2 database <?php /* Provoke an error -- the BONES table does not exist */ $sth = $dbh->prepare('SELECT skull FROM bones'); $sth->execute(); echo " PDOStatement::errorInfo(): "; $arr = $sth->errorInfo(); print_r($arr); ?> The above example will output: PDOStatement::errorInfo(): Array ( [0] => 42S02 [1] => -204 [2] => [IBM][CLI Driver][DB2/LINUX] SQL0204N "DANIELS.BONES" is an undefined name. SQLSTATE=42704 )
SEE ALSO
PDO.errorCode(3), PDO.errorInfo(3), PDOStatement.errorCode(3). PHP Documentation Group PDOSTATEMENT.ERRORINFO(3)
Related Man Pages
pdo.query(3) - php
pdostatement.execute(3) - php
pdo.exec(3) - php
pdostatement(3) - php
pdo.getattribute(3) - php
Similar Topics in the Unix Linux Community
Configure DISPLAY variable for DB2
Upgrading OS from 5.2 to 5.3
DB2 basics
Find common Strings in two large files
Copy same file with different variables