Hi use xml configs, the pdo constant is 1000 so cant set it in xml.
<database>
<adapter>Pdo_Mysql</adapter>
<params>
<host>localhost</host>
<username></username>
<password></password>
<dbname></dbname>
<profiler>
<enabled>true</enabled>
</profiler>
</params>
</database>
Ive managed to do this but its kludgy.
$dbConfig = $config->database->toArray();
$dbConfig['driver_options'] =
array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY=>true);
$dbConfig = new Zend_Config(array('database' => $dbConfig));
$db = Zend_Db::factory($dbConfig->database);
As the error says try to use fetchAll to keep it portable, fetchAll
doesnt call the PDO fetchAll however.
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