Here is my problem: I'm using one query to display album info and the album's tracks for a music artist. However, the code I'm using displays the album infoo after each track from the album.
Here's what the problem looks like: http://www.llcrew.com/test/tgone/disc/default.php
Here's how I want the data to display: http://www.llcrew.com/test/tgone/disc/disc.html
here is my code:
<?
// construct discography query
$query = "
SELECT
titles.title_id, titles.title, titles.label, titles.year, tracks.track_num, tracks.track_title
FROM
titles, tracks
WHERE
titles.title_id = tracks.title_id
ORDER BY
titles.year, tracks.track_num
";
// execute query
$result = mysql_query($query, $link_id);
// display each item
while ($fields = mysql_fetch_array($result)) {
?>
<img src="images/covers/<?=$fields["title_id"]?>.jpg">
<br>
<b><?=$fields["title"]?></b> - <i><?=$fields["label"]?></i> [<?=$fields["year"]?>]
<br>
<br>
<b>
<?if($fields["track_num"]<10){print("0");}print($fields["track_num"]);?>.</b> <?=$fields["track_title"]?>
<br>
<?}?>
Can anyone help me? Thanks.