我们在Zend手册上有这个:
$table = new Bugs();
$data = array(
'updated_on' => '2007-03-23',
'bug_status' => 'FIXED'
);
$where = $table->getAdapter()->quoteInto('bug_id = ?', 1234);
$table->update($data, $where);为什么我们再次需要getAdapter和quoteInto?我已经看过手册了,但我不明白。
那save()方法呢,我们不应该用它来代替它吗?
致敬,MEM
发布于 2010-11-27 17:11:25
Zend_Db_Table ()用于在使用Zend_Db_Table_Row时使用,如果仅使用save,则方法为update。
您粘贴的代码需要有getAdapter和quoteInfo,因为$table是Bugs的实例,但不一定是Zend_Db_Table_Row或Zend_Db_Table,因此它没有连接到数据库。
https://stackoverflow.com/questions/4289887
复制相似问题