<html>
<?php

$con = new mysqli("localhost","root","toor","museam_db");
mysqli_set_charset($con, 'utf8');

// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

$super_name=$_POST['isdb'];
$super_id=$_POST['isid'];

if(!isset($_POST['isid'])||!isset($_POST['isdb']))
	echo'Cannot get packets';


?>

<? if (isset($_POST['isdb']) && $_POST['isdb']=="room"){ ?>

<select name="agalm_room" class="form-control" onchange="bring_secondwho(<?=$_POST['isid']?>,this.value)">
   <?php
        $query = "SELECT id,full_name,num FROM ".$_POST['isdb']." WHERE museam_id=".$_POST['isid']." ORDER BY num ASC;";
        $result=mysqli_query($con, $query);  
            if($result)
                while(($row=$result->fetch_assoc())!= null){
                ?> <option value="<?=$row['id']?>"> <?= '['.$row['num'].']'.' '.$row['full_name']?> </option> <?php
        }
    ?>
    <option value="" disabled="" selected="">-----Αίθουσα-----</option>
</select>

<? }
 ?>



</html>


