here is script if i select the date then i get the data from database. but if i select any date then i can't get any data from database of selecting date from calender. can some one fixed it ?
<script language="JavaScript" type="text/javascript" src="calendar/calendar.js"></script>
<script src="jquery.js"></script>
<script>
$(document).ready(function()
{
//ajaxTime.php is called every second to get time from server
var refreshId = setInterval(function()
{
$('#timeval').load('ajaxTime.php?randval='+ Math.random());
}, 1000);
//stop the clock when this button is clicked
$("#stop").click(function()
{
clearInterval(refreshId);
});
});
</script>
<!--<strong><div align="right" id="timeval" style="color:#FF6600; font-family:Arial, Helvetica, sans-serif">--:--:--</div></strong>-->
<table width="420" border="1" >
<form name="showdraw" action="ooo.php" method="post">
<tr bgcolor="#FF6600">
<td><script> DateInput('cdate', true, 'YYYY-MM-DD'); </script></td>
<td> <input type="submit" value ="Show"> <input type="hidden" value="Show" name="d1"> </td>
</tr>
<tr bgcolor="#FF6600">
<td><font color=#2F4F4F><h2>Draw Time</h2></font></td>
<td><font color=#2F4F4F><h2>Wining Number</h2></font></td>
</tr>
</form>
<tbody>
<?php
include('connect.php');
if (isset($_GET["d1"])) { $d1= $_GET["d1"]; } else { $d1=('YYYY-MM-DD'); };
$result = $db->prepare("SELECT * FROM birthday WHERE date = :a");
$result->bindParam(':a', $d1);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<tr class="record">
<tr bgcolor="#EEF3E2">
<td><font size=5><font color='#008B00'><?php echo $row['dt']; ?></font></td>
<td><font size=5><font color='#008B00'><?php echo $row['wn']; ?></font></td>
<?php
}
?>
</tbody>
</table>
See Question&Answers more detail:os