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

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

			}


			echo $outputs;
		}
	}
	else
	{

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

			echo $outputs;
	}

?>
