Re: Problem with PDO exceptions
| From: | kesavan trichy rengarajan | Date: | Sun, 08 Mar 2009 07:03:03 +0000 |
| Subject: | Re: Problem with PDO exceptions | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-46057@lists.php.net to get a copy of this message | ||
yup, I have set the |PDO::ATTR_ERRMODE| attribute to
|PDO::ERRMODE_EXCEPTION|
and I am still not getting an exception!
My Code is something like this:
$query = $db->prepare($sql);
$query->execute($bind);
$row = $query->fetch(PDO::FETCH_ASSOC);
wher $db is the PDO obj and $sql is the sql query and $bind is the bound
parameter
On Sun, Mar 8, 2009 at 5:35 PM, Zoltan Ormandi <ormandi.zoltan@webfunteam.hu>
wrote:
> Hi,
>
> Did you set the value of the |PDO::ATTR_ERRMODE| attribute to
> |PDO::ERRMODE_EXCEPTION|?
>
> Btw, I don't think ||prepare would throw an exception even for a malformed
> query, but ||execute definitely should.
>
> Regards,
> Z
>
>