[MySQL] Getting data from 2 tables in 1 query
#2

You can only join data from different tables if you have a key to compare with. So no, I don't think that is possible. You can use union to put them beneath each other, but that's about it.
PHP код:
select 'accounts'count(*) from accounts
union
select 
'admins'count(*) from accounts where admin 0
union
select 
'vips'count(*) from accounts where vip 0
union
select 
'bans'count(*) from bans 
Reply


Messages In This Thread
[MySQL] Getting data from 2 tables in 1 query - by Deathlane - 01.06.2015, 10:57
Re: [MySQL] Getting data from 2 tables in 1 query - by Vince - 01.06.2015, 11:11
Re: [MySQL] Getting data from 2 tables in 1 query - by Konstantinos - 01.06.2015, 11:14

Forum Jump:


Users browsing this thread: 1 Guest(s)