Re: PDO Exception Handling Question
| From: | Cyril PIERRE de GEYER | Date: | Wed, 03 May 2006 15:02:47 +0000 |
| Subject: | Re: PDO Exception Handling Question | ||
| References: | 1 2 3 4 5 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-41804@lists.php.net to get a copy of this message | ||
Read on otn :
"PDO_ERRMODE_SILENT
This is the default mode; it will simply set the error code for you to inspect using the errorCode() and errorInfo() methods of both the statement and database handle objects.
if (!$dbh->exec($sql)) {
echo $dbh->errorCode() . "<br>";
$info = $dbh->errorInfo();
// $info[0] == $dbh->errorCode() unified error code
// $info[1] is the driver specific error code
// $info[2] is the driver specific error string"
Cyril PIERRE de GEYER a écrit :
And also my question is : "Why did the PDO creators (Wez the King?) decide to choose the silent mode for being the default one ?" Why not defining the ERRMODE_WARNING by default ? Or perhaps I misunderstand something, and I would be very happy to learn a bit :) Thx Cyril