<form action="tourdetails.php" method="get" name="main">
<table>
<tr>
<th >Select Country</th>
<td>
<select name="country">
<option>AllCountries</option>
<option value="0">Egypt</option>
<option value="1">India</option>
</select>
</td>
</tr>
<tr>
<th>Date</th>
<td>
<select name="day" id="day">
<option>Day</option>
<?php for($i=0;$i<32;$i++){?>
<option><?php echo $i;}?></option>
</select>
<?php
$options = '';
$today = mktime(0, 0, 0);
for ($i = 0; $i < 12; $i++)
{
$options .= sprintf("<option value=\"%s\">%s</option>\n", date('d/Y', $today),
date('M Y', $today));
$today = strtotime('+1 Month', $today);
}
echo "<select name='month'>{$options}</select>";
?>
</td>
<td>
<select name="period" id="period">
<option>Time</option>
<?php
$period=array("+/-7","+/-14","+/-21");
for($i=0;$i<count($period);$i++){?>
<option><?php echo $period[$i];}?></option>
</select>
</td>
<tr>
<th>Flexibilty</th>
<td><input name="notflexible" type="checkbox" value="0"></td>
</tr>
</tr>
<tr>
<th>Adults</th>
<td>
<select name="adults" id="adults">
<?php for($i=0;$i<11;$i++){?>
<option><?php echo $i;}?></option>
</select>
</td>
</tr>
<tr>
<th>Children</th>
<td>
<select name="children" id="children">
<?php for($i=0;$i<11;$i++){?>
<option><?php echo $i;}?></option>
</select>
</td>
</tr>
<tr>
<th>Seniors</th>
<td>
<select name="seniors" id="seniors">
<?php for($i=0;$i<11;$i++){?>
<option><?php echo $i;}?></option>
</select>
</td>
</tr>
<tr>
<th>AirFair</th>
<td>With<input name="with" type="checkbox" value="0">
Without<input name="without" type="checkbox" value="1" checked></td>
</tr>
<th>Package Type</th>
<td>
<select name="package">
<option>-------</option>
<option value="0">Standard</option>
<option value="1">Deluxe</option>
</select></td>
</table>
<input name="search" type="submit" value="search">
</form>
and i have made this
<?php
$conn = mysqli_connect("localhost", "root", "123456","tour");
$query= "select *from tours where
day like '%".$day."%' and
month like '".$month."' and
period like '".$period."' and
felxibilty like '".$notflexible."' and
adult like '".$adults."' and
children like '".$children."' and
seniors like '".$seniors."' and
packagetype like'".$package."'
";
$result=mysqli_query($conn,$query);
if (!$result) {
echo'Could not query:';
echo mysqli_error($conn);
exit();
}
echo "There are <b>".mysqli_num_rows($result)."</b> results found!!</br>";
echo "<hr>";
while($record=mysqli_fetch_assoc($result)){
while(list($name,$value)=each($record)){
echo "<b>".$name."</b>:".$value."</br>";
}
echo "</br>";
}
echo $back;
?>
and it deosnt seem to work