php - Online Booking Page -


i'm trying create website imaginary hotel every room has name ("room of sun", "room of moon", etc.)

i'm making booking page how should take room's names database using code:

echo'<select id="roomname" name="roomname" size="1"> '; {     include("include/connect.php");      $conn=mysql_connect($host, $user, $password);     $db_ok=mysql_select_db($db, $conn);     $cam=mysql_query("select name room", $conn);     $ncam=mysql_num_rows($cam);     ($i=0;$i<$ncam;$i++) {                   $f=mysql_result($cam,$i,"name");         echo "<option>$f</option>";     }     mysql_close($conn); } echo '</select>'; 

after have selected room: booking page has show remaining part of form starting , ending dates (with days when room free or rent) , how many people taking room.

here comes problem.. after select room, how can manage in order webpage show other options , in particular "select" loads what's maximum number of people can take room ? (kinda "select" used load room's name ^^ )

here there example:

echo'<select id="npeople" name="npeople" size="1"> '; { include("include/connect.php");          $conn=mysql_connect($host, $user, $password);         $db_ok=mysql_select_db($db, $conn);         $ris=mysql_query("select nrmax room name='<script type=text/javascript>document.booking.chamber.value</script>'", $conn);         $ros=intval($ris);         ($o=0;$o<$ros;$o++) {             $u=mysql_result($ris,$o,"nrmax");      echo "<option>$u</option>";         }         mysql_close($conn); } echo '</select>'; 

i think best way order rooms during select statements.

select * <tbl_rooms> <conditions here> order <room_size> desc, <room_price> asc


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -