SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist
    Join Date
    Oct 2005
    Posts
    415
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Difficult PHP Loop needed...can someone assist?

    Hi there sitepointers..

    I have a database of festivals that are in their own continent. What i need to do is find a loop that will display the festivals in a similar method to the following image.



    Any help would be very appriciated.

    Thanks

    Rodent

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2002
    Location
    Whistler, Canada
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you describe your database set up? What kind of database is it? If it's a MySQL database, have a look here and here.

    Cheers,
    Pepe

  3. #3
    SitePoint Evangelist
    Join Date
    Oct 2005
    Posts
    415
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a loop, and have done that many times..

    What i need is to loop it out in order down one column, then down the next etc etc. I know the mySQL_Fetch_array, its more of a while loop or method to display that picture.

    its a MySQL database yes...

    thx

  4. #4
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I'd say the HTML and CSS are more of a challenge. I would say that for each continent name you should use a heading (h3 or 4 probably) and then have an unordered list for the festival names. But for that column layout the list would have to be truncated.

    If you think of it as a table (but don't use a table!) each heading, festival name and gap between the last festival name and the next heading can count as one unit. Thus each column is, say, 40 units high. For each column you will probably need to use a floated div. Then in your loop set up a counter and when it reaches 40, you close the current div, start a new column and decide what the first unit is depending on whether the previous list finished or not.

  5. #5
    SitePoint Evangelist
    Join Date
    Oct 2005
    Posts
    415
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats a clever way to think about doing it....thanks for the suggestion...I will try to float divs left of each other and start from the beginning...

    Ill give it a try..thx

  6. #6
    SitePoint Evangelist
    Join Date
    Oct 2005
    Posts
    415
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fantastic...worked a treat...clever you...

    Rodent


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •