Forum Moderators: coopster
- Mariah carey
- we belong
- shake
- Tupac
- yow
my code is
$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), song, id FROM ".$prefix."_lyrics order by artist asc");
if ($db->sql_numrows($result)) {
while($row = $db->sql_fetchrow($result)) {
extract($row);
$artistinfo[$artist][] = $id;
}
foreach($artistinfo as $artist => $songsarr){
$content .="<optgroup label='$artist'>";
foreach ($songsarr as $id) {
$content .="<option value='modules.php?name=$module_name&file=song&c_id=$id'>$song</option>";
}
}
}
$content .="</select></form>";
the code is working like this
- Mariah carey
- 1
- 20
- Tupac
- 30
but I don't want it like that. what I want is to get song name instead of song id and print song name as sub-category of the artist.
so any help?