<?
include("opendb.php");
$result=mysqli_query($db,"select * from acgroups where nature='$nature' and level='$level'") or die(mysqli_error());
if(mysqli_num_rows($result)>0)
{
 print "<script> alert('Level has already been defined'); history.back(1); </script>";
 return;
}
 $sql="update acgroups set nature='$nature',level='$level' where gname='$gname'";
 mysqli_query($db,$sql) or die(mysqli_error());
include("acgroup.php");
?>
