$net->ninja; インターネット忍者

20May/09Off

how to pear mdb2 statement prepare, execute, free

No Gravatar

mdb2 = new &MDB2::factory($dsn, $options);
$sql = 'SELECT * FROM schema.table WHERE valueinteger = ? AND valuetext = ? AND valueboolean = ?';
$types = array('integer', 'text', 'boolean');
$statement = $mdb2->prepare($sql, $types);
$data = array('integer', 'text', true);
$resultset = $statement->execute($data);
$statement->free();
while ($rows = $resultset->fetchRow(MDB2_FETCHMODE_ASSOC)) {
//todo
}

16May/09Off

Call to undefined method MDB2_Error::execute()

No Gravatar

Error: Call to undefined method MDB2_Error::execute()

Solution: sql query check (missing table, missing column, missing data?)

Tagged as: , , Comments Off
16May/09Off

Call to undefined method MDB2::prepare()

No Gravatar

Call to undefined method MDB2::prepare()

Fixing solution: pear install -a -f MDB2_Driver_pgsql

lol
Tagged as: , , Comments Off
   

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.

$net->ninja; is Digg proof thanks to caching by WP Super Cache