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





$sql=mysql_query("select * from tbl_county where state_id='".$_POST['state_id']."' and county_status='1' order by county_name ASC ");

if(!sql)

{

	echo mysql_query();

}

else{

	if(mysql_num_rows($sql)>0)

	{

		$data='';

		while($res=mysql_fetch_array($sql))

		{

			if($_POST['edit_county_id']!='' && $_POST['edit_county_id']==$res['county_id'])

			{

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

			}

			else{

				$data.="<option value='".$res['county_id']."'>".$res['county_name']."</option>";

			}

		}

	}else{

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

	}

	echo $data;

}

?>