Blogger Information
Blog 20
fans 0
comment 0
visits 8102
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
thinkPHP 数据库高级查询及数据请求
P粉191340380
Original
327 people have browsed it

数据库高级查询

1. where条件
  1. $set = Db::table('mhh_user')->where('uid','>=',2)->select();
  2. print_r($set);
2. 模糊查询 LIKE
  1. $set = Db::table('mhh_user')->where('nickname','like','%编%')->select();
  2. print_r($set);
3. 模糊查询,取反 NOTLIKE
  1. $set = Db::table('mhh_user')->where('nickname','notlike','%编%')->select();
  2. print_r($set);
4.1 查询区间 BETWEEN
  1. $set = Db::table('mhh_user')->where('uid','between','5,10')->select();
  2. print_r($set);
4.2 查询区间 NOTBETWEEN
  1. $set = Db::table('mhh_user')->where('uid','NOTbetween','5,10')->select();
  2. print_r($set);
5 指定查询 IN
  1. $set = Db::table('mhh_user')->where('uid','in','5,7,10')->select();
  2. print_r($set);
6 不等于 <>
  1. $set = Db::table('mhh_user')->where('uid','<>','2')->select();
  2. print_r($set);

数据请求

GET和POST(把请求做了一个类 Request)
  1. print_r(Request::get());
  2. print_r(Request::post());
Correcting teacher:PHPzPHPz

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!