fluentpdo icon indicating copy to clipboard operation
fluentpdo copied to clipboard

how check errorInfo

Open makhondi opened this issue 6 years ago • 2 comments

Hi How do I get errors? errorInfo()

$query = $fluent->insertInto('article')->values($values)->execute();

makhondi avatar May 25 '19 21:05 makhondi

This is my code:

$fluent->getPdo()->errorCode(); $fluent->getPdo()->errorInfo();

liorphp avatar Jun 05 '19 20:06 liorphp

You can set this option for the PDO : PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION

And simply catch the exception.

liorphp avatar Sep 22 '19 17:09 liorphp