查询语言

普通查询
$where[$type]=$keywords;
$where[$type]=array('like',"%".$keywords."%");

$where['id']=array(array('gt',0),array('lt',10));

组合查询
$where['id']=array('gt',1);
$where['name']=array('like','%alex%');
$data= $user->where($where)->select();


复合查询
$where ['username']=array('like','%alex%');
$where['_logic']='or';
$where['id']=array('gt',1);
$data=$user->where($where)->select();

动态查询
$data=$user->getByUsername('alex0018');
$user->top8();

常用
$user->select();
$user->find();
$user->getField();
$user->where('id=1')->select();
$user->where($where)->select();
$user->count();$user->max();
$user->query('select * from xxx');
$user->excute('insert update delete');
$user->getByXX();$user->getById(1);$user->getByEmail('a');


$where['id']=1;
$where['username']=array('like','%alex%');

$user->data(array())->add();
$user->field('id, username,name as uname')->select();
$user ->order('id desc')->select();
$user—>order('id')->limit(5)->select();
$user->page('1,10')->selct();
$user->group('active')->select();
$user->group['active']->having('active=1')->select();

$user->join('A on  user.id= A.id')->select();


 

你可能感兴趣的:(查询,查询语言)