PDO won’t throw exceptions unless you tell it to. Have you run:
$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
on the PDO object?
More Related Contents:
- PHP / PDO echo data from database into a table
- Can I mix MySQL APIs in PHP?
- How to apply bindValue method in LIMIT clause?
- PDOException “could not find driver”
- Row count with PDO
- PDO get the last ID inserted
- How do I use password hashing with PDO to make my code more secure? [closed]
- Error when preparing a multiple insert query
- How to view query error in PDO PHP
- PDO::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers
- Insert/update helper function using PDO
- Resetting array pointer in PDO results
- PDO multiple queries
- How to bind parameters to a raw DB query in Laravel that’s used on a model?
- Do SQL connections opened with PDO in PHP have to be closed
- PDO::PARAM for type decimal?
- Update query with PDO and MySQL
- What is the advantage of using try {} catch {} versus if {} else {}
- Is “SET CHARACTER SET utf8” necessary?
- Alternative for mysql_num_rows using PDO
- ERROR: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it
- Set PDO to throw exceptions by default [duplicate]
- PDO: MySQL server has gone away
- return one value from database with mysql php pdo
- return multiple response data in one response
- How to get a query error from prepare() in PDO PHP?
- How can I pass an array of PDO parameters yet still specify their types?
- PHP PDO how to run a multiple query request?
- PHP: mysql v mysqli v pdo [closed]
- PDO and MySQL ‘between’