hi friends,
In my project, want to display data from Mysql between two date. Date was given by user only, according to that it take info from database,
And important things is display the retrieve information through table,
My Html coding :
<body>
<form method="post" action="reportviewinfo.php">
<label>From Time : </label><input type="text" name="from" /><br/><br/>
<label>To Time : </label><input type="text" name="to" /><br/><br/>
<input type="submit" name="submit" value="Submit" />
</form>
</body>
Php code
<?php
include("config.php");
if(isset($submit))
{
$from = $_POST['$from'];
$to = $_POST['$to'];
$submit = $_POST['$submit'];
$sql = "select * from report where dat >= '$fromtime' and dat <= '$totime' ";
$result= mysql_query($sql);
echo "<table> <table>
<tr>
<td>
Date</td>
<td>
S.No</td>
<td>
Circuit Name</td>
<td>
Section</td>
<td>
Time-IN</td>
<td>
Time-OUT</td>
<td>
Nature of Failure</td>
<td>
Cause of Failure</td>
<td>
Attended By</td>
<td>
Remark</td>
<td>
Failure Duration</td>
<td>
Repercussions</td>
</tr>" ;
while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
echo "<tr><td> {$row['dat']}</td> <td> {$row['sno']}</td> <td> {$row['name']}</td> <td> {$row['section']}</td> <td> {$row['timein']}</td> <td> {$row['timeout']}</td> <td> {$row['nature']}</td> <td> {$row['cause']}</td> <td> {$row['attended']}</td> <td> {$row['remark']}</td> <td> {$row['duration']}</td> <td> {$row['repercussion']}</td> </tr> <br/> " ;
}
echo "</table>" ;
It not working, plz help me....