我正在使用带有 codeigniter 的phpactiverecords 。我想将 PDO::ATTR_EMULATE_PREPARES 设置为 false
我在第 54 行添加PDO::ATTR_EMULATE_PREPARES => false
到$PDO_OPTIONS
文件../lib/Connection.php
中。它在以下位置引起未捕获的异常:
../lib/adenter code hereapters/MysqlAdapter.php(76): ActiveRecord\Connection->query('SET NAMES ?', Array)
任何想法?
例外
'42000, 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1
致命错误: /home/waqas/apps/FBI-PHP/sparks/php-activerecord/0.0.2/vendor/php-activerecord/lib/Connection.php:304 中带有消息的未捕获异常 'ActiveRecord\DatabaseException'
堆栈跟踪:
0) /home/waqas/apps/FBI-PHP/sparks/php-activerecord/0.0.2/vendor/php-activerecord/lib/adapters/MysqlAdapter.php(76): ActiveRecord\Connection->query('SET NAMES ?', Array)
1) /home/waqas/apps/FBI-PHP/sparks/php-activerecord/0.0.2/vendor/php-activerecord/lib/Connection.php(108): ActiveRecord\MysqlAdapter->set_encoding('utf8')
2) /home/waqas/apps/FBI-PHP/sparks/php-activerecord/0.0.2/vendor/php-activerecord/lib/ConnectionManager.php(33): ActiveRecord\Connection::instance('mysql://root:@l...')
3) /home/waqas/apps/FBI-PHP/sparks/php-activerecord/0.0.2/vendor/php-activerecord/lib/Table.php(103): ActiveRecord\ConnectionManager::get_connection(NULL)
4) /home/waqas/apps/FBI-PHP/s in /home/waqas/apps/FBI-PHP/sparks/php-activerecord/0.0.2/vendor/php-activerecord/lib/Connection.php on line 304