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
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;

}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.