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
https://forums.phpfreaks.com/topic/8965-need-help-with-mysql-loop-into-php/
Share on other sites

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.