This is s bit sloppy but it should work for you...
<table border="1" cellpadding="2" cellspacing="2">
$query = "
SELECT DISTINCT artist FROM music
WHERE $where
ORDER BY artist";
$result1 = mysql_query($query, $link_id);
while ($rows = mysql_fetch_array($result1)) {
$thisartist = $rows["artist"];
$countquery = "SELECT COUNT(*) as thiscount from music where artist = '$thisartist'";
$result2 = mysql_query($countquery, $link_id);
while ($rows2 = mysql_fetch_array($result2)) {
$artistcount = $rows2["thiscount"];
}
?>
<tr>
<td rowspan="<?PHP echo $thiscount;?>" valign="top"><b><?PHP echo $thisartist;?></b></td>
<?PHP
$titlequery = "
SELECT title FROM music
WHERE $where
ORDER BY title";
$result3 = mysql_query($titlequery, $link_id);
while ($rows3 = mysql_fetch_array($result3)) {
$thisartist = $rows3["title"];
?>
<td><?PHP $title;?></td>
</tr>
<tr>
<?PHP
}
}
?>
</tr>
<tr>
<td rowspan="1" valign="top"><b>Pearl Jam</b></td>
<td>Ten</td>
</tr>
</table>