Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <h5>Room Type</h5>
- <select id="category" name="category" required="">
- <?php
- include 'connect.php';
- $room= "SELECT * FROM roomtype";
- $resroom = $conn->query($room);
- while($roomtype = $resroom->fetch_assoc()){
- ?>
- <option value="<?php echo $roomtype['roomtype'];?>" ><?php echo $roomtype['roomtype'];?></option>
- <?php
- $max = $roomtype['guests'];
- }?>
- </select>
- <h5>Number of Guests *</h5>
- <select id="category1" name="guests" required="">
- <?php
- include 'connect.php';
- $inc = 1;
- if(isset($_POST))
- {
- $category = $_POST['category'];
- }
- $guest = "SELECT * FROM roomtype WHERE roomtype = $category";
- $g = $conn->query($guest);
- while($guest1 = $g->fetch_assoc()){
- while ($guest1 ['guests'] < 0){
- ?>
- <option value="1"><?php echo $inc; $inc = $inc + 1; }}?></option>
- </select>
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "booking";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- ?>
Add Comment
Please, Sign In to add comment