我像这样实例化我的数据库适配器:
return new \Phalcon\Db\Adapter\Pdo\MySql(array(
"host" => $options["host"],
"username" => $options["username"],
"password" => $options["password"],
"dbname" => $options["dbname"],
));
我希望能够强制所有查询被强制“缓冲”,如此处所述(pdo部分): http://us1.php.net/manual/en/mysqlinfo.concepts.buffering.php
我如何通过:
$pdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
到phalcon的pdo适配器?
答案 0 :(得分:3)
您可以按如下方式传递任何PDO选项:
return new \Phalcon\Db\Adapter\Pdo\MySql(array(
"host" => $options["host"],
"username" => $options["username"],
"password" => $options["password"],
"dbname" => $options["dbname"],
"options" => array(\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true)
));