批改状态:合格
老师批语:
符号查询 [<,>,<=,>=,<>]
id大于2 和id小于7的$res = Db::table('user')->where('id', '>', 2)->where('id', '<', 7)->select();printf("<pre>%s</pre>", print_r($res, true));id=2的$res = Db::table('user')->where('id', '=', 3)->select();printf("<pre>%s</pre>", print_r($res, true));
$res = Db::table('user')->where('name', 'like', '%编%')->select();printf("<pre>%s</pre>", print_r($res, true));//模糊取反$res = Db::table('user')->where('name', 'notlike', '%编%')->select();printf("<pre>%s</pre>", print_r($res, true));
$res = Db::table('user')->where('id', 'between', '2,7')->select();printf("<pre>%s</pre>", print_r($res, true));//区间取反$res = Db::table('user')->where('id', 'not between', '2,7')->select();printf("<pre>%s</pre>", print_r($res, true));
$res = Db::table('user')->field('id')->select();printf("<pre>%s</pre>", print_r($res, true));
$res = Db::table('user')->order('id', 'DESC')->select();printf("<pre>%s</pre>", print_r($res, true));
$res = Db::table('user')->limit(4, 10)->select();printf("<pre>%s</pre>", print_r($res, true));//page 专用分页查询$res = Db::table('user')->page(0, 5)->select();printf("<pre>%s</pre>", print_r($res, true));
//count$res = Db::table('user')->count();echo $res;
$res = Db::connect('lyb')->table('user_list')->select();printf("<pre>%s</pre>", print_r($res, true));
//数据请求// print_r(Request::get());// print_r(Request::post());


Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号