Medoo查询条件+排序+LIMIT

数据库评论2,910字数 631阅读2分6秒
$database->debug()->select("book", "*", ["ORDER" => ["date" => "DESC"]]);
//SELECT * FROM `book` ORDER BY `date` DESC
$database->debug()->select("book", "*", ["view" => "1","ORDER" => ["date" => "DESC"]]);
//SELECT * FROM `book` WHERE `view` = '1' ORDER BY `date` DESC
$database->debug()->select("book", "*", [
        "AND" => [
            "type" => $_GET["type"],
            "view" => "1"
        ],"ORDER" => ["date" => "DESC"]
    ]);
    //SELECT * FROM `book` WHERE (`type` = '1' AND `view` = '1') ORDER BY `date` DESC

LIMIT

$datas = $database->select("dede_addonimages", [
    "aid",
    "taobaoid"
]
    ,[
    "OR" =>[
        "tklupdate[<]"=>"$isend",
        "tklupdate"=>0
    ]
    ,
        "ORDER" => ["aid" => "DESC"], "LIMIT" => [0,5]
    ]
);
文章源自国强极客生活-https://tagqwl.com/4758.html
weinxin
我的微信
添加我的微信,有任何问题请与我直接联系(备注:国强极客生活)
  • 全部本人精心整理制作,希望大家多多支持。
  • 转载请务必保留本文链接:https://tagqwl.com/4758.html
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: