thinkphp3 joint table query
迷茫
迷茫 2017-06-07 09:23:28
0
1
1087

Take out several pieces of data from a table that satisfy the status value = 2, and then use the IDs of the pieces of data to check other tables.

How to use thinkphp

Not very good at joining table queries

select * from re_deposit where deposit_status = 2

select * from re_client INNER JOIN re_deposit on re_deposit.client_code = re_client.client_code

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
代言
select * from re_client INNER JOIN re_deposit on re_deposit.client_code = re_client.client_code
 where re_deposit.deposit_status = 2

*Note that if two tables have the same fields, the field will only be taken from one of the tables, so it is recommended to add a prefix to the word

//tp3 is probably written like this

M("re_client")->join("re_deposit on re_deposit.client_code = re_client.client_code","INNER JOIN")->where("re_deposit.deposit_status = 2")->select(); 
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template