$User = M("User"); // 实例化User对象 $condition['name'] = 'thinkphp'; $condition['status'] = 1; // 把查询条件传入查询方法 $User->where($condition)->select();
SELECT * FROM think_user WHERE `name`='thinkphp' AND status=1