I seem to be having trouble querying my ‘events’ table which contains foreign keys.
This is what I’ve built up:
$query = 'SELECT events.*, venues.*, music_styles.* FROM events, venues, music_styles'.
'INNER JOIN venues, music_styles v ON (events.VENUE_LOCATION = venues.ID) AND (events.MUSIC_STYLE_ID = music_styles.ID';
$result = mysql_query($query);
I tried to say that events.VENUE_LOCATION equals the ID of table ‘venues’ and that events.MUSIC_STYLE_ID equals the ID of table ‘music_styles’.
This is the error I got:
Invalid query: Not unique table/alias: ‘venues’
And this is my database design:

Thanks a lot everybody 🙂
Let’s cut the PHP stuff, which isn’t relevant. Your said,
That’s not quite right, that’s not how JOINs work. It should be,