Blogger Information
Blog 14
fans 1
comment 0
visits 25809
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Thinkphp5.1数据库增删改查操作——更新update()
centcool的博客
Original
4822 people have browsed it

一、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!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post