20May/09Off
how to pear mdb2 statement prepare, execute, free
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()
Error: Call to undefined method MDB2_Error::execute()
Solution: sql query check (missing table, missing column, missing data?)
16May/09Off
Call to undefined method MDB2::prepare()
Call to undefined method MDB2::prepare()
Fixing solution: pear install -a -f MDB2_Driver_pgsql
lol


