【发布时间】:2009-10-23 06:01:41
【问题描述】:
如果我想使用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 的疏忽?
【问题讨论】:
标签: zend-framework zend-db-table