When I echo my query the result is:
SELECT id, diwtitle, date_string FROM diw_alpha WHERE date_string = '--'
The dates are missing. However when I look at the URL, the numbers are correct.
http://localhost/depday.php?year=2005&month=May&day=16
Here is a portion of the calendar script, where I can click on the date to (eventually) go to the events of that date:
//Assign positions to days of week and identify the starting day
switch($day)
{
case "Monday" :
$startpos="2";
break;
case "Tuesday" :
$startpos="3";
break;
case "Wednesday" :
$startpos="4";
break;
case "Thursday" :
$startpos="5";
break;
case "Friday" :
$startpos="6";
break;
case "Saturday" :
$startpos="7";
break;
case "Sunday" :
$startpos="1";
break;
}
//next we need to determine how many rows of seven columns we need
$basenum=$startpos+$days-1;
$rows=ceil($basenum/7);
//Next, we draw the calendar body
$rowcount="1";
$daycount="1";
$calendar_day=0;
while ($rowcount<=$rows)
{
echo "<tr>";
$day_column=1;
while ($day_column<=7)
{
echo "<td>";
if ($daycount<$startpos)
echo " ";
elseif (($daycount-$startpos+1)>$days)
echo " ";
else
{
$calendar_day=$calendar_day+1;
echo ' <a href="depday.php?year='.$Year.'&month='.$Month.'&day='.$calendar_day.'"> '.$calendar_day,'</a> ';
// echo "$calendar_day";
}
$daycount=$daycount+1;
echo "</td>";
$day_column=$day_column+1;
}
echo "</tr>";
$rowcount=$rowcount+1;
}
//Finally, we finish the table
echo "</table>";
//echo test variables
//echo "start position is $startpos<br/>";
//echo "Month is $Month<br/>";
//echo "Year is $Year<br/>";
//echo "Starting Day is $day<br/>";
?>