Jump to content

Need help with mysql loop into PHP


johnska7

Recommended Posts

I'm trying to get a loop going from my mysql database, but I'm running into some logic problems. I think I just need to be shown the road.

What I'm trying to do is display a certain amount of dates, between june 1st of one year and june 1st of the next year, like this:

[img src=\"http://www.sbschools.org/images/chart.gif\" border=\"0\" alt=\"IPB Image\" /]

my database looks like this:

[img src=\"http://www.sbschools.org/images/db.gif\" border=\"0\" alt=\"IPB Image\" /]

So pretty much what I need to do is:

find out what's in the database and sort it into groups of years. For each of the dates returned, I have to find out if it should go into $date[0]-1."-06-01" or $date[0]+1."-06-01" so I can get the listing like in the first picture. Can anyone help me start on this path?

PS - Please ignore the first pictures dates being inconsistent...I just copy and pasted into photoshop
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.