对于update table1 set c1 = c1 +1 where。。。
语句在zend中如果用常规的方式会被解析为:update table1 set c1 = ‘c1 +1’ where。。。
可以通过以下方式来处理
public function updateworkpageReplySum( $id =0){
$db = $this->getAdapter();
$set = array('replysum'=>new Zend_Db_Expr('replysum+1'),'updatetime'=>new Zend_Db_Expr('NOW()'));
$where = $db->quoteInto('uuid = ?', $id);
$rows_affected = $db->update( $this->_name, $set, $where );
return $rows_affected ;
}
语句在zend中如果用常规的方式会被解析为:update table1 set c1 = ‘c1 +1’ where。。。
可以通过以下方式来处理
public function updateworkpageReplySum( $id =0){
$db = $this->getAdapter();
$set = array('replysum'=>new Zend_Db_Expr('replysum+1'),'updatetime'=>new Zend_Db_Expr('NOW()'));
$where = $db->quoteInto('uuid = ?', $id);
$rows_affected = $db->update( $this->_name, $set, $where );
return $rows_affected ;
}