以下下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,具体看他官网或源代码