I have a calendar set up in a mySQL table and I am trying to output the dates via monthly calendars (Jan, Feb, Mar) which accounts for the "missing days" for previous months and the following month.
So if I am trying to make a calendar for Jan 2013 and Jan 1 falls on a Tuesday -- I am having difficulty coding a method to show that Sun Dec 30 and Mon Dec 31 act as "space fillers" or what have you... know what I mean?
I am having a difficult time wrapping my head around how to output this info.
The data structure and data is as follows:
Table_name: sched_calendar_table
dt y q m d dw monthName dayName w isWeekday isHoliday holidayDescr isPayday
2010-01-01 2010 1 1 1 6 January Friday 0 1 1 New Year's Day 0
2010-01-02 2010 1 1 2 7 January Saturday 0 0 0 0
2010-01-03 2010 1 1 3 1 January Sunday 1 0 0 0
2010-01-04 2010 1 1 4 2 January Monday 1 1 0 0
2010-01-05 2010 1 1 5 3 January Tuesday 1 1 0 0
I plan on creating each monthly calendar using tables.
So the initial part of the code is:
echo '<table>';
$sql="SELECT * FROM sched_calendar_table WHERE y=2013";
$result=mysql_query($sql);
while($row=mysql_query($result)){
echo '<tr><td>'; // .. unsure how to account for the placeholder days that aren't part of the month being displayed... how to do this?
}
echo '</table>';