In php's medoo, if the where parameter has multiple sub-items, must 'AND' be used?

WBOY
Release: 2016-08-18 09:16:25
Original
1261 people have browsed it

The following MD() is my encapsulated method of extracting medoo

<code>
MD()->debug()->get('items_want',['id'],[
        'uid'=>74,
        'item_id'=>28,
    ]);
    </code>
Copy after login
Copy after login

//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>
Copy after login
Copy after login

You can output
SELECT "id" FROM "items_want" WHERE "uid" = 74 AND "item_id" = 28 LIMIT 1

Reply content:

The following MD() is my encapsulated method of extracting medoo

<code>
MD()->debug()->get('items_want',['id'],[
        'uid'=>74,
        'item_id'=>28,
    ]);
    </code>
Copy after login
Copy after login

//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>
Copy after login
Copy after login

You can output
SELECT "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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!