Which PDO attribute should be set so query failures raise exceptions?
- A PDO::ATTR_ERRMODE set to PDO::ERRMODE_EXCEPTION
- B PDO::ATTR_PERSISTENT
- C PDO::ATTR_TIMEOUT
- D PDO::ATTR_CASE
Answer
PDO::ATTR_ERRMODE set to PDO::ERRMODE_EXCEPTION
Without it, failures can be silently ignored and the code continues with a false return value, producing confusing downstream errors.





