一、update()必须要有更新条件;
二、如果成功,返回更新条数,如果失败,返回0
public function update(){ //update()必须要有更新条件 //如果成功,返回更新条数,如果失败,返回0 $data = ['name'=>'奥巴马','email'=>'aobama@usa.com']; return Db::table('student')->where('id',1)->update($data); }
Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号