Posted by Jim Hernandez on 11/12/05 08:22
nevermind i sorted out a proper mysql statement and i turned up with this
+----------+------------------+---------+------------------------+
| artistid | artistname | albumid | atitle |
+----------+------------------+---------+------------------------+
| 1 | blah | 1 | blah album |
| 4 | cab | 2 | cab album |
| 3 | dab | 3 | dab album |
| 2 | fab | 4 | fab album |
| 2 | fab | 5 | fab album 2 |
+----------+------------------+---------+------------------------+
$oldArtistID = false;
for each row {
if($row['artistid'] != $oldArtistID) {
//it's a new artist, so show their name and stuff
$oldArtistID = $row['artistid'];
}
if you could just give me a description of how $oldartistID comes into
play? i think i understand the rest of it.
for every row it checks artist id against oldartistid and if its new it
lists the artist, if not then it skips it and moves on to where i'd then
place some code that will code each albumrow as a link with a php echo
calling the link with the url parameter. no?
Navigation:
[Reply to this message]
|