语法
Db::table(表名)->where(条件)->select();
示例
Db::table(‘think_user‘)->where(‘type=1 AND status=1‘)->select();
预处理机制
Db::table(‘think_user‘)->where("id=:id and username=:name")
->bind([‘id‘=>[1,\PDO::PARAM_INT],‘name‘=>‘thinkphp‘])
->select();本文出自 “素颜” 博客,请务必保留此出处http://suyanzhu.blog.51cto.com/8050189/1896470
原文:http://suyanzhu.blog.51cto.com/8050189/1896470