You can add the setAttribute function to the constructor:
$pdo = new PDO('mysql:host=localhost;dbname=someDatabase', 'username', 'password', array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
));
But I cannot find a method to add it to the php.ini file or some other config file.
More Related Contents:
- mysqli or PDO – what are the pros and cons? [closed]
- PDOException SQLSTATE[HY000] [2002] No such file or directory
- PHP PDO: charset, set names?
- How to get numeric types from MySQL using PDO?
- How can I use PDO to fetch a results array in PHP?
- PHP PDOException: “SQLSTATE[HY093]: Invalid parameter number”
- Use bound parameter multiple times
- What is the difference between MySQL, MySQLi and PDO? [closed]
- MySQL check if a table exists without throwing an exception
- how safe are PDO prepared statements
- Can I use a PDO prepared statement to bind an identifier (a table or field name) or a syntax keyword?
- PHP PDO – Num Rows
- How to solve General error: 2006 MySQL server has gone away
- Replacing mysql_* functions with PDO and prepared statements
- PDO + MySQL and broken UTF-8 encoding
- PDOstatement (MySQL): inserting value 0 into a bit(1) field results in 1 written in table
- php code to test pdo is available?
- PDO fetchAll group key-value pairs into assoc array
- How to insert an array into a single MySQL Prepared statement w/ PHP and PDO
- Setting a connect timeout with PDO
- In PHP with PDO, how to check the final SQL parametrized query? [duplicate]
- What is the best way to insert multiple rows in PHP PDO MYSQL?
- PDO MySQL: Insert multiple rows in one query
- How to bind LIKE values using the PDO extension?
- Error while using PDO prepared statements and LIMIT in query [duplicate]
- PDO prepared statement fetch() returning double results
- Warning: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in
- SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
- PHP 7 RC3: How to install missing MySQL PDO
- Is a BLOB converted using the current/default charset in MySQL?