<? include_once("../includes/main.inc.php");



$sql=mysql_query("select * from tbl_block where city_id='".$_POST['city_id']."' and county_id='".$_POST['county_id']."' and country_id='".$_POST['country_id']."' and state_id='".$_POST['state_id']."'");

if(!sql)

{

	echo mysql_query();

}

else{

	if(mysql_num_rows($sql)>0)

	{

		$data='';

		while($res=mysql_fetch_array($sql))

		{

			if($_POST['edit_block_id']!='' && $_POST['edit_block_id']==$res['block_id'])

			{

				$data.= "<option value='".$res['block_id']."' selected='selected'>".$res['block_name']."</option>";

			}

			else{

				$data.="<option value='".$res['block_id']."'>".$res['block_name']."</option>";

			}

		}

	}else{

		$data.="<option value=''>--Not Available--</option>";

	}

	echo $data;

}

?>