html page
<form method="get" action="sort2.php">
<table>
<tr>
<td>id</td><td><input type="text" name="id"></td>
</tr>
<tr>
<td>From</td><td><input type="text" name="from"></td>
<td>To</td><td><input type="text" name="to"></td>
<td><input type="submit" name="submit" value="submit"></td></tr>
</table>
</form>
sort2.php
<?php
$id=$_REQUEST;
$to=$_REQUEST;
$from=$_REQUEST;
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");
$query="(select name,id from member where id=(select day,time from attend where day between '$from' and '$to')";
$result = mysql_query($query) or die ('Error in query: $query. ' . mysql_error());
echo "<table width='90%'>";
echo "<tr><td bgcolor='#008080'><font face='Times New Roman' color='#FFFFFF' size='2'><strong>Day</strong></font> </td>
<td bgcolor='#008080'><font face='Times New Roman' color='#FFFFFF' size='2'><strong>Name</strong></font> </td>
<td bgcolor='#008080'><font face='Times New Roman' color='#FFFFFF' size='2'><strong>Time</strong></font> </td></tr>";
if (mysql_num_rows($result) > 0 )
{
while($row = mysql_fetch_row($result))
{
echo "<tr>";
echo "<td>".$row[0]."</td><td>".$row[1]."</td><td> ".$row[2]."</td>";
echo "</tr>";
echo "<tr><td bgcolor='#008080'></td><td bgcolor='#008080'></td><td bgcolor='#008080'></td></tr>";
}
echo "</table>";
}
mytable
tb1
id(primary key)
name....
tb2
day,time,id........
please tell me how to fetch the name,day,time from the table and display