这是我的更新功能:
$id = 5; $points = 100;
public function update($id, $points) {
$this->update(array('points = ?' => new Zend_DB_Expr('points + 1')), array('id = ?' => $id));
}
但是,当我调用此函数时会发生错误:
** SQLSTATE [HY093]:参数号无效:没有参数被绑定
答案 0 :(得分:4)
应该是
$this->update (array (
'points' => new Zend_DB_Expr ('points + 1')
), array (
'id = ?' => $id
));