I have a simple problem regarding a nested query. To be honest I don't know if it can be done through one query only or if I'll have to use PHP.
Put simply, I want to return the users information from the users tables by the users IDs returned from a select statement in relations table.
I can do this by 2 queries and some PHP loop but for saving resources, but I think it's better to combine it into 1 query and single loop.
First query
SELECT UserID FROM relations WHERE GroupID = '1'
Second query I need to retrieve the user info from the user table by the returned UsersIDs from the first select statement.
I can do this by loop through the ID and making the queries but I think I can get all in 1 query.
Thanks