$db = Db::instance('development');
$db->update('mailList')->cols(array('status'=>1,'times'=>'times'+1))->where('id='.$id)->query();
Workerman中這樣寫報錯
zend 中可以這樣寫:
$db = Zend_Db_Table::getDefaultAdapter();
$where = $db->qutoInto('id = ?',$id);
$db->update('mailList',array('status'=>1,'times'=>new Zend_Db_Expr('times+'.1)),$where)
還是只能取的時候多取一個字段加
$db->update('mailList')->cols(array('status'=>1,'times'=>$times+1))->where('id='.$id)->query();
update mailList set status=1, times = times+1 where id =1;