Home > Backend Development > PHP Tutorial > How to write compound sql in php's medoo?

How to write compound sql in php's medoo?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-08-18 09:16:19
Original
1210 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?

$database->query('select * from `items` where `id` in (select `uid` where `is_test`=1)')->fetchAll();
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:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template