使用(MD()
是我寫的一個獲取medoo物件的方法)
<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>
會輸出這句sql語句,跟中文文件說的不一樣,最後的order by
沒有加上DESC
,這是為什麼?實際查出來的數據也的確沒有倒序
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"
使用(MD()
是我寫的一個獲取medoo物件的方法)
<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>
會輸出這句sql語句,跟中文文件說的不一樣,最後的order by
沒有加上DESC
,這是為什麼?實際查出來的數據也的確沒有倒序
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"]