Example #1
0
 /**
  * 对符合当前条件的记录执行update
  * @param $data
  * @return bool
  */
 function update($data)
 {
     $update = "";
     foreach ($data as $key => $value) {
         $value = $this->db->quote($value);
         if ($value != '' and $value[0] == '`') {
             $update = $update . "`{$key}`={$value},";
         } else {
             $update = $update . "`{$key}`='{$value}',";
         }
     }
     $update = substr($update, 0, -1);
     return $this->db->query("update {$this->table} set {$update} {$this->where} {$this->limit}");
 }