<?php
//echo 'okay';
include_once('../../db_connect/db.php');
//$local_id=$_POST['lga'];
$local_id=00;
$site=$_POST['site'];
$block=$_POST['block'];
$r = mysqli_query($conn_1, "SELECT *  FROM hostel_rooms where campus_id ='$site' AND block_id='$block' ORDER BY title ");
	if(mysqli_num_rows($r) > 0 )
	{
		while($row = mysqli_fetch_array($r, MYSQLI_ASSOC))
		{
			if($local_id == $row['id'])
			{
				$output = "<option value=\"$row[id]\" selected>";
				$output .=  $row['title'];
				$output .="</option>";

			}
			else
			{
				$output = "<option value=\"$row[id]\" >";
				$output .= $row['title'];
				$output .="</option>";

			}


			echo $output;
		}
	}
	else
	{

			$output = "<option>";
			$output .="Not added yet";
			$output .="</option>";

			echo $output;
	}

?>
