Use (MD()
is a method I wrote to get medoo objects)
<code>MD()->debug()->select('items',[ '[>]items_pic'=>['id'=>'item_id'] ],['items.id','items_pic.src'],[ 'AND'=>[ 'items.uid'=>19, 'items.is_delete'=>0 ], 'ORDER'=>'items.id DESC' ]) </code>
will output this sql statement, which is different from the Chinese document. The last order by
does not include DESC
. Why is this? The actual data found is indeed not in reverse order
SELECT "items"."id","items_pic"."src" FROM "items" LEFT JOIN "items_pic" ON "items"."id" = "items_pic"."item_id" WHERE "items"."uid " = 19 AND "items"."is_delete" = 0 ORDER BY "items"."id"
Use (MD()
is a method I wrote to get medoo objects)
<code>MD()->debug()->select('items',[ '[>]items_pic'=>['id'=>'item_id'] ],['items.id','items_pic.src'],[ 'AND'=>[ 'items.uid'=>19, 'items.is_delete'=>0 ], 'ORDER'=>'items.id DESC' ]) </code>
will output this sql statement, which is different from the Chinese document. The last order by
does not include DESC
. Why is this? The actual data found is indeed not in reverse order
SELECT "items"."id","items_pic"."src" FROM "items" LEFT JOIN "items_pic" ON "items"."id" = "items_pic"."item_id" WHERE "items"."uid " = 19 AND "items"."is_delete" = 0 ORDER BY "items"."id"
"ORDER" => ["item.id"=>"DESC"]