Jump to content

Listing retrieved fields


lostcities

Recommended Posts

My basic scenario is i am doind a discography for a band.

I have set u a table (disco_darling) for id, title, albumArtSrc, credits,

and have also set up a table (tracklisting_darling) for id, track01, track02, track03, track04 etc up to track20,

 

i have put information into the tables and displaying the information from disco_darling is sorted and works fine, but the tracklisting_darling data i want to display each field in a new <li> within an ordered list so:

<li>$row->track01</li>

<li>$row->track02</li> and so on.

 

And i am confused how to loop it to do this?

 

Any help would be most appreciated!

 

//Mark

Link to comment
https://forums.phpfreaks.com/topic/69924-listing-retrieved-fields/
Share on other sites

first, select using an order by on track name, if that's all you have. Ideally, you'd have a field for track order as well, otherwise you're stuck either listing the tracks alphabetically or adding a numeric prefix in front of each track name to identify it's order.

 

then loop over the record set using

 

while ($line = mysql_fetch_array($result)) {

// do stuff here;

}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.