Medoo是一款超轻量级的PHP SQL数据库框架,由社交网站Catfan和开源项目Qatrix的创始人开发。提供了简单,易学,灵活的API,提升开发Web应用的效率与性能
官方网站: https://medoo.in/
Medoo框架查询指定条件并排序的实例:
$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
希望可供借鉴。
© 版权声明
THE END
暂无评论内容