I am trying to do a mysql sort that displays 0 first and then by the smallest number.
$query = "SELECT DISTINCT id FROM `items` WHERE `name`='Mag' AND `var`='Bl' ORDER BY atrow + 0 ASC"
How to write it in medoo?
$item = $database->select("items", "@id", [
"var[=]" => "Bl",
"name[=]" => "Mag",
"ORDER" => ["atrow" => "ASC"]
]);
This is not working properly.
You need a two tiered sort here. Assuming we use the following raw MySQL query:
PHP code: