<meta charset="utf-8">
<?php 

include('dbcon.php');

	
	$name = $_POST['sectionnom'];
	
	
	
	$query2=mysqli_query($conn,"select * from tbl_section where sectionnom='$name'")or die(mysqli_error($conn));
		$count=mysqli_num_rows($query2);

		if ($count>0)
		{
			echo "<script type='text/javascript'>alert('Désolé!!! Vous enregistrez le DCE déjà enregistré');</script>";
			echo "<script>document.location='form_section.php'</script>";  
		}
		
		else
		{	

			

			mysqli_query($conn,"INSERT INTO tbl_section(sectionnom) VALUES('$name')")or die(mysqli_error($conn));

			echo "<script type='text/javascript'>alert('Merci !!! une nouvelle section est enregistrement avec succes!');</script>";
					  echo "<script>document.location='form_section.php'</script>";  
		}
?>