periodid int auto_increment primary key
startdate date not null
enddate date not null
All dates between the startdate and enddate need to be identified on calendar. Startdate and enddate can be any dates with more than one period in a month.
if (isset($startdate)) {
$pricesperiodstart = array_combine($pricesperiodid, $startdate);
}
if (isset($enddate)) {
$pricesperiodend = array_combine($pricesperiodid, $enddate);
}
}
Help! At this point I am stuck! I am wanting to generate all the dates required into another array so that I can then check against the calendar dates using
in_array
Or is there a completely different way anybody can suggest??
My thinking with periodid was that I could use this to avoid confusion between various periods if we had, for example during March a startdate of 2nd and enddate of 6th and another startdate of 8th and enddate of 12th, the arrays would be something like this with the index to both arrays being the periodid.
array( [1] => 2009-03-02 [2] => 2010-03-08 ) for startdate and
array( [1] => 2009-03-06 [2] => 2010-03-12 ) for enddate
However if making an array as you suggest this may be irrelevant.
This leaves me with one discrepancy which I am struggling to rectify. The very last date that should be in the array is missing. How can I correct this without loosing the first date?