i have a simple table with pics, names and mp3s. ONE name and pic PER artist, sometimes multiple mp3s... the query i've managed to put together creates a table row for each, obviously, but i'd rather query for each unique pic and name and retrieve each mp3 (and ultimately print them in the right cell like "$title" is now).
could someone please lend me a hand with a query that do this? i'd be forever grateful...
thanks loads,
g
("fk_artist" and "id_artist" are the two fields unique to each artist)
$target_qid = mysql_query("SELECT name_artist, picId, title_music FROM fp_music INNER JOIN fp_artists ON fp_music.fk_artist = fp_artists.id_artist");
$variable_string_audio.= "<table width=\"326\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\"><tr><td height=\"5\" valign=\"top\"></td></tr>";
while($target_row = mysql_fetch_array($target_qid))
{
$pic = trim($target_row[1]);
$pic = ereg_replace(" ", "%20", $pic);
$name = ucwords($target_row[0]);
$title = $target_row["title_music"];
$variable_string_audio.= "<tr><td width=\"100\" height=\"100\" valign=\"top\"><a href=\"player3.php\" target=\"main\"><img src=../stars/".$pic." border=\"0\"></a></td>";
$variable_string_audio.= "<td class=\"style2\" valign=\"top\" width=\"216\" height=\"10\">";
$variable_string_audio.= "<a href=\"player3.php\" target=\"main\" class=\"style1\">".$name."</a>" . "<br><br>";
$variable_string_audio.= $title;
$variable_string_audio.= "</td></tr>";
$variable_string_audio.= "<tr><td height=\"1\" colspan=\"2\" align=\"center\"><img src=\"../imgs/gray.gif\" height=\"1\" width=\"250\"></a></td>";
}
$variable_string_audio.= "</table>";
print($variable_string_audio);