I am looking for a way to combine multiple SQL queries to save having to keep calling the database. I have three tables, one with a clubs details, one with the club facilities and the third combines them.
Here is a simple version of the tables:
t1
id, name, city
1, curby, London
2, zoo, Birmingham
t2
id, facility
1, bar
2, function suite
3, VIP room
t3
id, club_id, facility_id
1, 2, 1
2, 2, 3
3, 1, 2
4, 2, 2
In all of the above the first columns (id) are just unique identifiers, and I am using commas to show you where each field separates. What I would like to get from the database is something like:
1, curby, London, function suite
2, zoo, Birmingham, bar, VIP room, function suite
If any one has any ideas please share :)