flemingmike Posted May 18, 2011 Share Posted May 18, 2011 hello all, i have 2 fields in a table. one as startdate and one as enddate. i was wondering if there is a way to make a table with all the dates from start to end as the column headers. then i want to check the table to see if there are any other entries that exist within those dates. and make a new row under with a Y in the cell that it exists in. any direction/help is much appreciated. thanks, mike Link to comment https://forums.phpfreaks.com/topic/236770-date-overlap/ Share on other sites More sharing options...
otuatail Posted May 18, 2011 Share Posted May 18, 2011 I think it would help if you explained this as an example of a problem. If you want to extend a table with extra fields then this could be a very wide table. What is the actual problem. Desmond. Link to comment https://forums.phpfreaks.com/topic/236770-date-overlap/#findComment-1217114 Share on other sites More sharing options...
flemingmike Posted May 18, 2011 Author Share Posted May 18, 2011 problem 1: field 1 - id field 2 - start date field 3 - end date example data field 1 - 22 field 2 - 2011-05-12 field 3 - 2011-05-16 im trying to figure out how to populate all dates between field 2 and field 3 and have them as the column header in a table. maybe something like: echo "<table border='0' style='border-collapse: collapse' bordercolorlight='#000000' bordercolordark='#000000' width='90%' align='center'>"; echo "<tr> <th>2011-05-12</th> <th>2011-05-13</th> <th>2011-05-14</th> <th>2011-05-15</th> <th>2011-05-16</th> </tr>"; Link to comment https://forums.phpfreaks.com/topic/236770-date-overlap/#findComment-1217118 Share on other sites More sharing options...
otuatail Posted May 18, 2011 Share Posted May 18, 2011 If there are lots of rows in the table like field 2 - 2011-05-12 field 3 - 2011-05-16 field 2 - 2010-07-12 field 3 - 2012-05-16 field 2 - 2009-05-12 field 3 - 2009-05-16 Then you are going to have to find the lowest date and the highest date and have a web page with all the dates in between. is this what you have in mind? you can find the lowest and highest no problem. Desmond. Link to comment https://forums.phpfreaks.com/topic/236770-date-overlap/#findComment-1217122 Share on other sites More sharing options...
flemingmike Posted May 18, 2011 Author Share Posted May 18, 2011 hmm.. what im trying to do is have people check in with there start and end dates. at the end i want someone to be able to query to see if anybody else will be checked in on overlapping dates. so if im checked in from may 5-10, and you are checked in may 7-12, i want that to show up in the query so i can see that you and i will be checked in between may 7-10. is that possible? Link to comment https://forums.phpfreaks.com/topic/236770-date-overlap/#findComment-1217152 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.