Voting

: max(two, seven)?
(Example: nine)

The Note You're Voting On

Matthias Leuffen
19 years ago
Hi,

List containing all SQL-92 SQLSTATE Return Codes:
http://www.unix.org.ua/orelly/java-ent/jenut/ch08_06.htm

Use the following Code to let PDO throw Exceptions (PDOException) on Error.

<?PHP
$pdo
= new PDO (whatever);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
try {
$pdo->exec ("QUERY WITH SYNTAX ERROR");
} catch (
PDOException $e) {
if (
$e->getCode() == '2A000')
echo
"Syntax Error: ".$e->getMessage();
}
?>

Bye,
Matthias

<< Back to user notes page

To Top