Respected Sir,
i have query abt the PHP code..
i have form with
Country as "listbox"...selects country from list
state as listbox .......selects state from listbox
city as listbox .......selects city from list box
hotel name as "text"...wherein user can enter hotel name to search"
star rating as "listbox"...which gives the star-ratings as 1 star,2 star and 5 star..
now aftr this thr is one button called "SEARCH"
so whn user clicks on this search button..
the table containg the "HOtel_cd,Hotel_name,City,State,Star_rating..all these details should be displayed..
the table has fieleds
tablename:"hoteldetails"
|--------------------------|
| Hotel_cd |
|--------------------------|
|Hotel_name |
|--------------------------|
|Star_rating |
|--------------------------|
| city |
|------------------------- |
| state |
|--------------------------|
so i want to kno the PHP query which will retrieve data from this table whn country="India" , State="GOa" ,star_rating="any" or"1 star", or "2star" ,"3 star", "4 star" or "5 star"and City can be either"north goa or south goa"
depending on selection of listboxes the table should be dispalyed.
my source code is here wherin i can select the city but i want to display the table selecting the city a well as Star_rating options.
the star_rating can be "any", "1 star", 2 star", "3 star", "4 star","5 star".
<html>
<head>
<title>Display hotel List</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
include 'config.php';
//include 'opendb.php';
mysql_select_db('Travel') or die("cannot select the database");
$query = "SELECT hotel_cd,hotel_name,star_rating,city,state FROM hoteldetails WHERE city='Northgoa' ";
$result = mysql_query($query) or die ("cannot select");
echo'<table border="1"><tr><td>Hotel Code</td><td>Hotel Name</td><td>Star Rating</td><td>City</td><td>State</td></tr>';
while(list($hotel_cd,$hotel_name,$star_rating,$city,$state)=mysql_fetch_array($result))
{
echo"<tr><td>$hotel_cd</td><td>$hotel_name</td><td>stae_rating</td><td>$city</td><td>$state</td></tr>";
}
echo'</table>';
echo'<br>';
mysql_close();
?>
</body>
</html>