您好,登錄后才能下訂單哦!
區間查詢 默認使用AND 在最后面元素加上OR SELECT * FROM `weibo_user` WHERE ( `id` > 1 OR `id` < 3 )
$map['id']=array(
array('gt',1),
array('lt',3),
'OR'
);
組合查詢 SELECT * FROM `weibo_user` WHERE `id` = 1 OR ( username = "bnbbs" AND email like "%bnbb%" )
$map['id']=array('eq',1);
$map['_string']='username = "bnbbs" AND email like "%bnbb%"';
$map['_logic']="OR";
請求字符串查詢
$map['id']=array('eq',1);
$map['_query']='username=bnbbs&_logic=OR';
$map['_logic']='OR';
復合查詢 SELECT * FROM `weibo_user` WHERE `id` = 1 OR ( `id` = 2 )
$map['id']=array('eq',1);
$where['id']=array('eq',2);
$map['_complex']=$where;
$map['_logic']='OR';
統計查詢 count() SELECT COUNT(*) AS tp_count FROM `weibo_user` LIMIT 1
最大查詢 max(id) SELECT MAX(id) AS tp_max FROM `weibo_user` LIMIT 1
最小查詢 min(id) SELECT MIN(id) AS tp_min FROM `weibo_user` LIMIT 1
平均值查詢 avg(id) SELECT AVG(id) AS tp_avg FROM `weibo_user` LIMIT 1
求和查詢 sum(id) SELECT SUM(id) AS tp_sum FROM `weibo_user` LIMIT 1
動態查詢
getByField(value) SELECT * FROM `weibo_user` WHERE `id` = 1 LIMIT 1
getByField(value) SELECT * FROM `weibo_user` WHERE `username` = 'bnbbs' LIMIT 1
getFieldByField(value) SELECT `id` FROM `weibo_user` WHERE `username` = 'bnbbs' LIMIT 1
SQL查詢 query($sql)只讀 execute($sql)只寫
var_dump($user->query('select * from weibo_user'));
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。