I'm trying to set PDO::MYSQL_ATTR_FOUND_ROWS
attribute to true in PDO, but I cannot seem to set it. I am using PHP 5.4.16 and MySQL 5.5.PDO
and pdo_mysql
both appear in my phpinfo()
.
Here is how I try to set it to true.
public function __construct () {
$dsn = 'mysql:host=' . DB_HOST . ';dbname=' . DB_NAME . ';charset=utf8';
$this->_db = new PDO($dsn,DB_USER,DB_PASS);
// The following setAttribute() returns FALSE.
$this->_db->setAttribute(PDO::MYSQL_ATTR_FOUND_ROWS, TRUE);
}
I tried to look for every possible settings I can think of. What am I still missing?