Need a Help!
| From: | Mohamed Yusuf | Date: | Mon, 12 Dec 2005 19:41:59 +0000 |
| Subject: | Need a Help! | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-40851@lists.php.net to get a copy of this message | ||
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