Code: Select all
<?php
$query = "SELECT l.lyricid,l.hits,t.titlename FROM lyrichits AS l LEFT JOIN titles AS t ON (l.lyricid=t.lyricid) ORDER BY hits DESC LIMIT 0,10";
?>tables:
-<span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> //visits to every lyric. fields: lyricid(relation),hits.
-titles //contains all the titles. fields: titleid,lyricid(relation),titlename,artistid(relation)
-artists //contains the name of the artists. fields: artistid(relation),artistname
-lyrics //table not used. fields: lyricid(relation),data
and the sql query has to return the top 10 lyrics with this data:
artistid,artistname,lyricid,titlename
and for this i need two joins instead of one, a thing that i don't know how to do, any help