How to write compound sql in php's medoo?

WBOY
Release: 2016-08-18 09:16:19
Original
1114 people have browsed it

<code>select * from `items` where `id` in (select `uid` where `is_test`=1)
</code>
Copy after login
Copy after login

I want to check data like this, how can I write it like this in medoo?

Reply content:

<code>select * from `items` where `id` in (select `uid` where `is_test`=1)
</code>
Copy after login
Copy after login

I want to check data like this, how can I write it like this in medoo?

<code class="php">$database->query('select * from `items` where `id` in (select `uid` where `is_test`=1)')->fetchAll();</code>
Copy after login

$db->select('items', '*', ['id'=>$db->select('table', 'uid', ['is_test'=>1])]) ;

The statement in your in above should be missing table? It’s almost like this, you can change it accordingly. It's best to read the official documentation, it's all there. Some of the Chinese version documents are older and have not been updated.

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!