一、update()必须要有更新条件;
二、如果成功,返回更新条数,如果失败,返回0
public function update(){
//update()必须要有更新条件
//如果成功,返回更新条数,如果失败,返回0
$data = ['name'=>'奥巴马','email'=>'aobama@usa.com'];
return Db::table('student')->where('id',1)->update($data);
}
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!