<?php 


if(($_POST['act']== 'delete_lgas')) {
	$id_array = $_POST['lga']; // return array
	$id_count = count($_POST['lga']); // count array
	
	for($i=0; $i < $id_count; $i++) {
		$id = $id_array[$i];
		$query = mysqli_query(dbc(),"DELETE FROM `lga` WHERE `id` = '$id'");
		if(!$query) { die(mysql_error()); }
	}
	header("Location: gateway.php?act=view_lgas&is=Successfully Deleted"); // redient after deleting
}
?>