語法
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