<?php

require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include ('includes/function.php');



$maindb = 'hotels';

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);
$hotelnm = $_REQUEST["hotelnm"];
$mhotl = mysqli_query($conn, "SELECT category FROM hotels where code='$hotelnm' ") or die(mysqli_error($conn));
while ($thotl = mysqli_fetch_array($mhotl)) {
    $mhotcatg = mysqli_query($conn, "SELECT code,name FROM hotelcatg where code='$thotl[category]'") or die(mysqli_error($conn));
    $thotcatg = mysqli_fetch_array($mhotcatg);
    echo "<option value='$thotcatg[code]'>$thotcatg[name]</option>";
}
?>