<?php
include_once('../../../db_connect/db.php');
//$local_id=$_POST['lga'];
$room_id=00;
$block_id=$_POST['block_id'];
$r = mysqli_query($conn_1, "SELECT *  FROM hostel_rooms WHERE block_id = '$block_id' ");
	if(mysqli_num_rows($r) > 0 )
	{
		while($row_rm = mysqli_fetch_array($r, MYSQLI_ASSOC))
		{
			if($room_id == $row_rm['id'])
			{
				$output_rm = "<option value=\"$row_rm[id]\" selected>";
				$output_rm .=  $row_rm['title'];
				$output_rm .="</option>";

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

			}


			echo $output_rm;
		}
	}
	else
	{

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

			echo $output_rm;
	}

?>
