I'm guessing this has to do cant set pdo options in xml configs. And setAttribute is ideal but wont work until the connection is made.

$dbConfig = $config->database->toArray();
$dbConfig['params']['driver_options'] = array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY=>true);
$db = Zend_Db::factory($config->database->adapter, $dbConfig['params']);
$db->setFetchMode(Zend_Db::FETCH_ASSOC);
$registry->set('db', $db);

On 12/11/2007, at 3:48 PM, Dan Rossi wrote:

Aparantly this is also possible but only when a connection is made so after the first query unless db connect is made.

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


Exceptions are bubbled up to the error controller.

On 12/11/2007, at 3:23 PM, till wrote:

On Nov 11, 2007 11:09 PM, Dan Rossi <[EMAIL PROTECTED]> wrote:
Ive tried to also add the config to the config object but there is issues
with it


$config->database->driver_options = array();
$db = Zend_Db::factory($config->database);

Fatal error: Uncaught exception 'Zend_Config_Exception' with message
'Zend_Config is read only' in

Sorry man, but isn't the error obvious? You tried to manipulate your
Zend_Config object but you are not supposed to.

A try/catch block around that should help you out.

On 12/11/2007, at 3:00 PM, Dan Rossi wrote:

Hi there still getting these errors, it doesnt seem that Zend_Db is actually calling fetchAll on the PDO library, the result isnt being free'd so im
getting this error

General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering
by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

Any ideas ? I cant seem to append this option as i use xml for the configs.

What does one have to do with the other?

To set pdoparams, Example 10.7:
http://framework.zend.com/manual/en/zend.db.html

Cheers,
Till


Reply via email to