<?php 
require_once("initialize.php");?>
<?php ob_start();?>
<?php session_start();?>
<?php

// defined('DB_USER') ? null : define("DB_USER", "oscotech_adUser");
// defined('DB_PASS') ? null : define("DB_PASS", "oscotech_adPass");
// defined('DB_NAME') ? null : define("DB_NAME", "oscotech_admission");


$connection = mysqli_connect('localhost', 'oscotech_adUser', 'oscotech_adPass');
if ($connection){
	$db = mysqli_select_db($connection,'oscotech_admission');
}
if (!$db){
	die("Database selection failed");
}

if (isset($_POST['state_id'])){
	
	
	if ($_POST['state_id']!=''){
$output='';
$stateid= explode('|',$_POST['state_id']);
//$stateid=$_POST['state_id'];
//print_r($stateid);
$sql = mysqli_query($connection,"select * from local_governments where state_id=$stateid[0] ");	
	
	if (!$sql){
		die("Query execution failed".mysqli_error($connection));
	}
	while($row = mysqli_fetch_array($sql)){
		
		$output.='<option value="'.$row['name'].'">'.strtoupper($row['name']).'</option>';		
		
	}
	echo $output;
}
}
?>