v5:reference:connection:errorno
This is an old revision of the document!
errorNo
Description
The method errorNo returns an unfriendly error number about the last known error. Note that depending on th DBMS, the message may contain string identifiers.
If there is currently no error, the function returns false
Usage
/* * Oracle database connection assumed */ /* * An invalid SQL statement that violates a constraint */ $SQL = 'INSERT INTO test (ID) VALUES (0)'; /* * Execute the statement, suppressing any errors */ $desc = @$db->execute($SQL); /* * Get the last error number */ $e = $db->errorNo(); print $e; /* * returns: 'ORA-00001' */
v5/reference/connection/errorno.1771807119.txt.gz · Last modified: by mnewnham
