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



$sql=mysql_query("select * from tbl_city where county_id='".$_POST['county_id']."' and state_id='".$_POST['state_id']."'  and city_status='1' order by city_name ASC ");

if(!sql)

{

	echo mysql_query();

}

else{

	if(mysql_num_rows($sql)>0)

	{

		$data='';

		while($res=mysql_fetch_array($sql))

		{

			if($_POST['edit_city_id']!='' && $_POST['edit_city_id']==$res['city_id'])

			{

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

			}

			else{

				$data.="<option value='".$res['city_id']."'>".$res['city_name']."</option>";

			}

		}

	}else{

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

	}

	echo $data;

}

?>