HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /var/www/nclive/backend/institute_get_state_list.php
<?php
header("Access-Control-Allow-Origin: *");
header('Content-Type: application/json');
include "config.php";

	$getInstStateQuery="SELECT inst.state_id, count(inst.id) as count, s.state_name, s.image_icon, s.state_slug FROM sp_institutions as inst INNER JOIN sp_states as s ON s.state_id=inst.state_id WHERE inst.status='1' group by inst.state_id order by s.state_name";	

	$sqlInstState=$db->prepare($getInstStateQuery);
	$sqlInstState->execute();

	$instStateDataArray = array();
	while($rowInstState=$sqlInstState->fetch()){	
		$state_id= $rowInstState['state_id'];
		$inst_count= $rowInstState['count'];
		$state_name = $rowInstState['state_name'];
		$state_slug = $rowInstState['state_slug'];
		$state_image = $rowInstState['image_icon'];
		
		$instStateArray=array("state_id"=>$state_id, "state_name"=>$state_name, "inst_count"=>$inst_count, "state_slug"=>$state_slug, "state_image"=>$state_image);
		$instStateDataArray[]=$instStateArray;
	}	

	echo json_encode($instStateDataArray , TRUE);

?>