Gearsopedia.net
New Member
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'.ProblemI would like to show all artists that have one (or more) tags in common with a given artist.\[code\]function getSimilarArtists($artist_id){ $sql = "SELECT ..."; $query = mysql_query($sql); while($artist = mysql_fetch_assoc($query)) { $html .= "<li>".$artist['name']."</li>" } print($html);}\[/code\]Tablesartists\[code\]id | name\[/code\]artisttags\[code\]id | artist_id | tag_id \[/code\]tags\[code\]id | tag_name\[/code\]Any help is welcome.Thanks