我在很多场合使用过Zend_Db_Table更新,但这次我遇到了问题。我不知道为什么这样,请告诉我我做错了什么。
$where = $directory->getAdapter()->quoteInto('id = ?', $id);
$total_votes = array('total_votes' => '(total_votes + 1)');
$directory->update($total_votes, $where);
/// $directory is a db table variable.
它没有更新数据库中的值。我使用Profiler打印查询:
**UPDATE dealers_directory SET `total_votes` = ? WHERE (`id` = 3)**
我不明白为什么要添加“?”而不是(total_votes + 1)。我已经在同一个应用程序的几个地方使用它,它工作正常,但我不知道这里有什么问题。
感谢。