Re: PDO Exceptions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On 4/22/2013 11:55 AM, Onatawahtaw wrote:

I am new to this list. I have a question about which functions need to be included in a try block.

Of "new PDO", "prepare", "bindParam", "execute", "fetch", and "query", it seems that bindParam is the only one that throws an exception. So is this the only that needs to be put into a try block?


Proverbs 3:5-6

Since nobody else has offered anything, I'll give you my impression of how a try handles things.

If the statement(s) within the try block fail in any way (such as simply returning a 'false' value), the try block's catch will be executed. So while the items you specified do not "throw an exception", I believe the try will still handle a failure of those functions.

Of course, if I'm wrong, I'm positive we'll start seeing responses to your question. :)

PHP Database Mailing List (
To unsubscribe, visit:

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux