Do I need to use the try and catch block to display errors with PHP\'s PDO extension?
For example, with mysql you can usally do something like:
if ( ! $q
public static function qry($sql) {
try {
$statement = $db_handle->prepare($sql);
$retval = $statement->execute();
if($statement->rowCount() >= 1) {
//do something
}else {
$errors = $statement->errorInfo();
echo $errors[2] . ", " . $errors[1] . " ," . $errors[0];
}
} catch (Exception $e) {
echo $e->getMessage();
}
}