Blogger Information
Blog 2
fans 0
comment 0
visits 1289
Related recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
5月23日作业
Ar5lan的博客
Original
650 people have browsed it

1、table()

$table=Db::table('think_user')->where('id',1)->find();

//table方法必须指定完整的数据表名

2、field()

Db:table('thinkphp_user')->field('id,name,title')->select();

//field()方法主要目的是标识要返回或者操作的字段

3、order()

Db:table('think_user')->where('uid',2)->order('id desc')->select();

order()方法用于对操作的结果排序

4、where()

Db:table('think_user')->where('status',1)->select();

//where()方法设置判断条件

5、limit()

Db:table('think_user')->where('id','<',10)->limit(5)->select();

//limit()方法:主要用于指定查询和操作的数量

6、insert()

$data=['foo'=>'bar','name'=>'hong'];

Db:table('think_user')->insert($data);

//insert()方法:用于数据库添加数据

7、insertAll()

$data=[

['name'=>'hong','age'=>36],

['name'=>'hong','age'=>36]

];

Db:table('think_user')->insertAll($data);

//insertAll()方法:用于添加多条数据

8、update()

Db:table('think_user')->where('id',2)->update(['khmc'=>'shidai']);

//update()方法:用于更新数据

9、delete()

Db:table('think_user')->delete(2);

//delete()方法:用于删除数据

Correction status:qualified

Teacher's comments:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!