语法
Db::table(表名)->where(条件)->select();
示例
$map['name'] = 'thinkphp';$map['status'] = 1;// 把查询条件传入查询方法Db::table('think_user')->where($map)->select();
对应原始sql
SELECT * FROM think_user WHERE `name`='thinkphp' AND status=1
本文共 262 字,大约阅读时间需要 1 分钟。
语法
Db::table(表名)->where(条件)->select();
示例
$map['name'] = 'thinkphp';$map['status'] = 1;// 把查询条件传入查询方法Db::table('think_user')->where($map)->select();
对应原始sql
SELECT * FROM think_user WHERE `name`='thinkphp' AND status=1
转载于:https://blog.51cto.com/suyanzhu/1896468