johnska7 Posted May 3, 2006 Share Posted May 3, 2006 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 More sharing options...
emehrkay Posted May 3, 2006 Share Posted May 3, 2006 trySELECT * FROM table WHERE start_date <= THIS YEAR AND start_date >= LAST YEAR .... Link to comment https://forums.phpfreaks.com/topic/8965-need-help-with-mysql-loop-into-php/#findComment-32935 Share on other sites More sharing options...
craygo Posted May 3, 2006 Share Posted May 3, 2006 So your year goes from june 1st to May 31stRay Link to comment https://forums.phpfreaks.com/topic/8965-need-help-with-mysql-loop-into-php/#findComment-33021 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.