I was wondering if I could get a little help writing a query in mysql.
I have a search engine form that allows users to check off a list of criteria they want the music artist to have (plays drums, plays guitar, reads sheet music, etc). All this information is stored in a table that looks something like this:
artistTalent TABLE:
artistID | talentID
2 | 3
4 | 5
2 | 8
...
and the talent table (and artist table follows similar format) looks something like this:
talent TABLE:
talentID | talentName
1 | drums
2 | sheet music
....
my query looks like this:
SELECT artistID,artistName from artists, talent WHERE artists.artistID = talent.talentID
My problem is that if the user clicks off three talents they want the person they're searching for to have, then they get three results if the one artist has three talents that were selected.
I am guessing I need to do some sort of JOIN but am not 100% sure how.
Any help would be appreciated