I have three tables:
- artists
- events
- events_artists (many-to-many)
So, If I where to get a list of all the artists linked to a certain event and also get a list of those NOT linked to that event, I'd guess a left outer join would be needed, right?
ex:
artists
id - name
1 - joe
2 - bob
3 - jack
4 - john
events
id - title
1 - bigparty
2 - smallparty
events_artists
eventid - artistid
1 - 2
1 - 3
1 - 4
2 - 1
2 - 3
I know how to get the artists related to a certain event.But how would I get the artists NOT linked to a certain event? For example, event with ID = 2?PHP Code:$sql = "SELECT art.*, ea.artist_id FROM artists as art, events_artists as ea WHERE ea.artist_id = art.id AND event_id = $eid";
I hope I explained myself properly. Any help is well apreciated.![]()






Bookmarks