Hey guys and gals.
I'm having a little trouble here.
I want to do the following:
Display a table that lists different songs. I want them to be output so that in the far left hand column is the year, and then there are 5 other columns with info provided through the database. Easy enough, I can do that.
Viewable Here: http://umbcmamasboys.org/test.php
Now I want to modify the script so that you don't see repeats of the same year. Here's an Example:
Year | Song Info
2004 | Title, Artist, Album, Arranger
.......| Title, Artist, Album, Arranger
.......| Title, Artist, Album, Arranger
2005 | Title, Artist, Album, Arranger
So I have the code to already view all the information. So here's the question:
How do I edit the code so that I don't see a repeat of the same year?
<?php
$db_conn = mysql_connect('localhost', 'db_user', '********');
mysql_select_db('db_db', $db_conn);
$query = 'SELECT * FROM `music_repertoire` ORDER BY `Year`';
$result = mysql_query($query);
echo '<table width="100%" border="1">'."\n".
'<tr><th>Year Performed</th><th colspan="5">Song Information</th><tr>'."\n".
'<tr><td bgcolor="#CCCCC"></td><th>Title</th><th>Artist</th><th>Album</th><th>Arranger</th><th>Download Clip</th></tr>'."\n";
while($song = mysql_fetch_array($result)){
echo '<tr>'.
'<td>'.$song['Year'].'</td>'.
'<td>'.$song['Title'].'</td>'."\n".
'<td>'.$song['Artist'].'</td>'."\n".
'<td>'.$song['Album'].'</td>'."\n".
'<td>'.$song['Arranger'].'</td>'."\n".
'<td><a href="'.$song['Clip'].'">Download Now</a></td>'."\n".
'</tr>';
}
echo '</table>';
?>
Thanks for the help.
~Brett