<?php
	include 'connection.php';
	$dist=ucwords($_POST['district']);
	$block=ucwords($_POST['block']);
	$check="SELECT * FROM blocks WHERE name='$block'";
	$result=mysqli_query($con,$check);
	if (mysqli_num_rows($result)) {
		echo "Data already added";
	}
	else{
		$query="INSERT INTO blocks(name,district) VALUES('$block','$dist')";
		if (mysqli_query($con,$query)) {
			echo "Block Successful Add";
		}
		else{
			echo "Something Error";
		}
	}
	

?>