public function hits($id){ $sql="UPDATE message SET hit = hit+1 where id = $id "; $this->query($sql); } 可以放到类里面调用 转载于:https://blog.51cto.com/rc699/1108169