How to show event by calender date

I have made a calender and i want to highlight todays date,and i have store some events in a databses…

How can i show events below the calender and when there is some event on todays date, it extract from the database and show that event below calender.

this is my calender coding:

<?php
$con = mysql_connect(“localhost”,“root”,“root”);
if (!$con)
{
die('Could not connect: ’ . mysql_error());
}

$monthNames = Array(“January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”);
if (!isset($_REQUEST[“month”])) $_REQUEST[“month”] = date(“n”);
if (!isset($_REQUEST[“year”])) $_REQUEST[“year”] = date(“Y”);

$cMonth = $_REQUEST[“month”];
$cYear = $_REQUEST[“year”];

$prev_year = $cYear;
$next_year = $cYear;

$prev_month = $cMonth-1;
$next_month = $cMonth+1;

if ($prev_month == 0 ) {
$prev_month = 12;
$prev_year = $cYear - 1;

}
if ($next_month == 13 ) {
$next_month = 1;
$next_year = $cYear + 1;
}
?>
<div id=“calendar_div” name=“calendar_div”>
<table width=“200” align=“center”>
<tr >
<td bgcolor=“#999999” style=“color:#FFFFFF”>
<table width=“100%” border=“0” cellspacing=“0” cellpadding=“0”>
<tr>
<td width=“50%” align=“left”>  <a href=“<?php echo $_SERVER[“PHP_SELF”] . “?month=”. $prev_month . “&year=” . $prev_year; ?>” style=“color:#FFFFFF”>Previous</a></td>
<td width=“50%” align=“right”><a href=“<?php echo $_SERVER[“PHP_SELF”] . “?month=”. $next_month . “&year=” . $next_year; ?>” style=“color:#FFFFFF”>Next</a>  </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align=“center”>
<table width=“100%” border=“0” cellpadding=“2” cellspacing=“2”>
<tr align=“center”>
<td colspan=“7” bgcolor=“#999999” style=“color:#FFFFFF”><strong><?php echo $monthNames[$cMonth-1].’ '.$cYear; ?></strong></td>
</tr>
<tr>
<td align=“center” bgcolor=“#999999” style=“color:#FFFFFF”><strong>S</strong></td>
<td align=“center” bgcolor=“#999999” style=“color:#FFFFFF”><strong>M</strong></td>
<td align=“center” bgcolor=“#999999” style=“color:#FFFFFF”><strong>T</strong></td>
<td align=“center” bgcolor=“#999999” style=“color:#FFFFFF”><strong>W</strong></td>
<td align=“center” bgcolor=“#999999” style=“color:#FFFFFF”><strong>T</strong></td>
<td align=“center” bgcolor=“#999999” style=“color:#FFFFFF”><strong>F</strong></td>
<td align=“center” bgcolor=“#999999” style=“color:#FFFFFF”><strong>S</strong></td>
</tr>

            &lt;?php 
            	$timestamp = mktime(0,0,0,$cMonth,1,$cYear);
            	$maxday    = date("t",$timestamp);
            	$thismonth = getdate ($timestamp);
            	$startday  = $thismonth['wday'];

              for ($i=0; $i&lt;($maxday+$startday); $i++) {
                if(($i % 7) == 0 ) echo "&lt;tr&gt;\

";
if($i < $startday) echo "<td></td>
";
else echo “<td align=‘center’ valign=‘middle’ height=‘20px’>”. ($i - $startday + 1) . "</td>
";
if(($i % 7) == 6 ) echo "</tr>
";
}
?>
</table>
</td>
</tr>
</table>
</div>

plz help me…

SELECT
 ....
FROM tablename
WHERE datecolumn = NOW()

or

SELECT
 ....
FROM tablename
WHERE datecolumn = CURDATE()

depends on how you’ve defined the date column.

but where i should write this query in calender program and and i have defined date column as date which take date in yy/mm/dd.

If you only and always want to extract today’s events, you can run the query at the top of the script. The code that displays the results you’ll have to add at the point where you want to display the results.

and and i have defined date column as date which take date in yy/mm/dd.

Defined as DATE ? Then you can use the second query (CURDATE).