<?php require_once 'dbconnect.php';
$loaderDivName = (isset($loaderDivName))? $loaderDivName : 'cityDiv';

		?>
		<span id="<?=$loaderDivName;?>">
		<select name="mycity" id="mycity" class="reginput">
		<?
		if((isset($_REQUEST['stateId'])) && ($_REQUEST['stateId'])){
		
		$sql = "select * from lookup_city where state_id = '".$_REQUEST['stateId']."' order by city_name";
//		$results = mysqli_query($sql)or die(mysql_error());
		$results = $mysqli -> query($sql)or die(mysql_error());
		
		$cnt = 0;
			while($row = mysqli_fetch_array($results)){
				$cnt = $cnt + 1
				?><option value="<?=$row['city_name'];?>"><?=$row['city_name'];?></option><?
			}
			if(!$cnt){
				?><option value="">-</option><?
			}
		}else{
			?>
			<option value="">---Select--</option>
			<?
		}
		?>
		</select>
		</span>
		<?

?>