如果我想使用该Zend_Db_Table->update()
方法用数据更新我的表,我无论如何都找不到在“where”子句中使用绑定变量。
方法签名是:
int update($data, array|string $where)
通常你会这样调用方法:
$table = new Bugs();
$data = array(
'updated_on' => '2007-03-23',
'bug_status' => 'FIXED'
);
$where = $table->getAdapter()->quoteInto('bug_id = ?', 1234);
$table->update($data, $where);
quoteInto
只是要转义变量,而不是绑定它。
需要有一种方法来使用绑定变量,否则 DBMS 不会有效地缓存这个查询。
我是否遗漏了什么,或者这是 Zend 的疏忽?