Home >Backend Development >PHP Tutorial >In php's medoo, if the where parameter has multiple sub-items, must 'AND' be used?
The following MD() is my encapsulated method of extracting medoo
<code> MD()->debug()->get('items_want',['id'],[ 'uid'=>74, 'item_id'=>28, ]); </code>
//For example, in the above example, the output sql is actually: SELECT "id" FROM "items_want" WHERE "uid" = 74 "item_id" = 28 LIMIT 1
And
<code>MD()->debug()->get('items_want',['id'],[ 'AND'=>[ 'uid'=>74, 'item_id'=>28, ] ]) </code>
You can outputSELECT "id" FROM "items_want" WHERE "uid" = 74 AND "item_id" = 28 LIMIT 1
The following MD() is my encapsulated method of extracting medoo
<code> MD()->debug()->get('items_want',['id'],[ 'uid'=>74, 'item_id'=>28, ]); </code>
//For example, in the above example, the output sql is actually: SELECT "id" FROM "items_want" WHERE "uid" = 74 "item_id" = 28 LIMIT 1
And
<code>MD()->debug()->get('items_want',['id'],[ 'AND'=>[ 'uid'=>74, 'item_id'=>28, ] ]) </code>
You can outputSELECT "id" FROM "items_want" WHERE "uid" = 74 AND "item_id" = 28 LIMIT 1
Yes, because we need to deal with the relationship between AND and OR, this method is quite logical
Medoo must use and for multiple conditions, please refer to its official website or source code for details