0

那是我的更新功能:

$id = 5; $points = 100;

public function update($id, $points) {
    $this->update(array('points = ?' => new Zend_DB_Expr('points + 1')), array('id = ?' => $id));
}

但是,当我调用此函数时,会发生错误:

**SQLSTATE[HY093]:参数号无效:没有绑定参数

4

1 回答 1

4

应该是

$this->update (array (
    'points' => new Zend_DB_Expr ('points + 1') 
), array (
    'id = ?' => $id 
));
于 2012-09-13T06:17:31.833 回答