I have table and insert data using song_id, that means one artist can have many song_ids. my question is how can I query distinct artist with his/her song_id while I will not get duplicate data like duplicate artist? my code is like this $content .="<form id=\"form1\" method=\"post\" action=\"\"> <select name=\"Quick\" onchange=\"MM_jumpMenu('parent',this,0)\"> <option value=\"#\">Select Artist</option>"; $result= $db->sql_query("SELECT distinct(artist), id FROM ".$prefix."_lyrics order by artist asc"); if ($db->sql_numrows($result)) { while($row = $db->sql_fetchrow($result)) { extract($row); $content .="<option value='modules.php ?name=$module_name&file=artist&c_id=$id'>$artist</option>"; } } $content .="</select> </form>"; that code is fine except it gives me duplicate artist, so I want get rid off that duplicate. any help