以下下MD()是我封裝的提取 medoo的方法
<code> MD()->debug()->get('items_want',['id'],[ 'uid'=>74, 'item_id'=>28, ]); </code>
//比如說上面這個,輸出的sql居然是:SELECT "id" FROM "items_want" WHERE "uid" = 74 "item_id" = 28 LIMIT 1
而
<code>MD()->debug()->get('items_want',['id'],[ 'AND'=>[ 'uid'=>74, 'item_id'=>28, ] ]) </code>
就能輸出SELECT "id" FROM "items_want" WHERE "uid" = 74 AND "item_id" = 28 LIMIT 1
以下下MD()是我封裝的提取 medoo的方法
<code> MD()->debug()->get('items_want',['id'],[ 'uid'=>74, 'item_id'=>28, ]); </code>
//比如說上面這個,輸出的sql居然是:SELECT "id" FROM "items_want" WHERE "uid" = 74 "item_id" = 28 LIMIT 1
而
<code>MD()->debug()->get('items_want',['id'],[ 'AND'=>[ 'uid'=>74, 'item_id'=>28, ] ]) </code>
就能輸出SELECT "id" FROM "items_want" WHERE "uid" = 74 AND "item_id" = 28 LIMIT 1
對的,因為要處理 AND 和 OR 的關係,所以這種方式還是比較符合邏輯的
medoo多條件必須用and,具體看他官網或原始碼