Reputation: 259
That is my update function:
$id = 5; $points = 100;
public function update($id, $points) {
$this->update(array('points = ?' => new Zend_DB_Expr('points + 1')), array('id = ?' => $id));
}
But, when I call this function an occurs error:
**SQLSTATE[HY093]: Invalid parameter number: no parameters were bound
Upvotes: 0
Views: 569
Reputation: 16035
It should have been
$this->update (array (
'points' => new Zend_DB_Expr ('points + 1')
), array (
'id = ?' => $id
));
Upvotes: 4