Add this line after you connect and sql errors will behave as all other php errors:
$PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
To catch them by yourself add your own error handling using set_error_handler().
Add this line after you connect and sql errors will behave as all other php errors:
$PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
To catch them by yourself add your own error handling using set_error_handler().