Question

I instantiate my db adapter like this:

return new \Phalcon\Db\Adapter\Pdo\MySql(array(
    "host"     => $options["host"],
    "username" => $options["username"],
    "password" => $options["password"],
    "dbname"   => $options["dbname"],
));

I would like to be able to force all my queries to be forced to "buffered" as explained here (pdo part): http://us1.php.net/manual/en/mysqlinfo.concepts.buffering.php

How can I pass:

$pdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);

to phalcon's pdo adapter ?

Was it helpful?

Solution

You can pass any PDO option as follows:

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)
));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top