Hi,
Situation:
In my database I have a table called 'artists' and 'tags'.
Each artist has a set of tags, saved in a linking table 'artisttags'.
Each unique tag is saved in a table called 'tags'.
Problem
I would like to show all artists that have one (or more) tags in common with a given artist.
function getSimilarArtists($artist_id)
{
$sql = "SELECT ...";
$query = mysql_query($sql);
while($artist = mysql_fetch_assoc($query))
{
$html .= "<li>".$artist['name']."</li>"
}
print($html);
}
Tables
artists
id | name
artisttags
id | artist_id | tag_id
tags
id | tag_name
Any help is welcome.
Thanks