I have this date script.
I need the script to show all dates from the selected month/year.
//Display current monthly events
echo "<table width=\"100%\" border=\"1\">\n";
echo "<tr>\n";
echo "<td><b>Event</b></td>\n";
echo "<td><b>Start Date</b></td>\n";
echo "<td><b>End Date</b></td>\n";
echo "<td><b>Location</b></td>\n";
echo "<td><b>Contact Person</b></td>\n";
echo "<td><b>Comments</b></td>\n";
echo "</tr>\n";
if ($_GET['action'] == 'View') {
$month = str_repeat("0", (2 - strlen($_GET['months']))).$_GET['months'];
$result2 = mysql_query("select event,
DATE_FORMAT( startdate, '%M %d, %Y' ) as sd,
DATE_FORMAT( enddate, '%M %d, %Y' ) as ed,
location, contact, comments from events where
startdate = '".$_GET['years']."-$month-01'");
echo $_GET['years'];
echo ' ';
echo $month;
if (mysql_num_rows($result2)) {
while ($rows2 = mysql_fetch_array($result2)) {
echo "<tr>\n";
echo "<td>".$rows2['event']."</td>\n";
echo "<td>".$rows2['sd']."</td>\n";
echo "<td>".$rows2['ed']."</td>\n";
echo "<td>".$rows2['location']."</td>\n";
echo "<td>".$rows2['contact']."</td>\n";
echo "<td>".$rows2['comments']."</td>\n";
echo "</tr>\n";
}
} else {
echo "<tr>\n";
echo "<td> </td>\n";
echo "<td></td>\n";
echo "<td></td>\n";
echo "<td></td>\n";
echo "<td></td>\n";
echo "<td></td>\n";
echo "</tr>\n";
}
} else {
//Display current month events only
if (mysql_num_rows($result1)) {
while($rows1 = mysql_fetch_array($result1)) {
echo "<tr>\n";
echo "<td>".$rows1['event']."</td>\n";
echo "<td>".$rows1['sd']."</td>\n";
echo "<td>".$rows1['ed']."</td>\n";
echo "<td>".$rows1['location']."</td>\n";
echo "<td>".$rows1['contact']."</td>\n";
echo "<td>".$rows1['comments']."</td>\n";
echo "</tr>\n";
}
} else {
echo "<tr>\n";
echo "<td> </td>\n";
echo "<td></td>\n";
echo "<td></td>\n";
echo "<td></td>\n";
echo "<td></td>\n";
echo "<td></td>\n";
echo "</tr>\n";
}
}
echo "</table>";
?>
When the dates are selected, only the 1st of the month is being returned.
The url is:
http://cahedev.nmsu.edu/eventscopy