prepare("select * from students where regno = :rg") ; $chk->bindparam(":rg" , $regno) ; $chk->execute() ; if($chk->rowcount() > 0) { $message = "The Regno or Admission No you entered already Exist in your Database, Please assign the Student Another Regno. Thanks" ; } else { $insert = $DBcon->prepare("insert into students(studentname,regno,avatar,admyear,gender,dob,address,denomination,town,lga,states,nof,pof,pvs,pvc,prc,stphone) values(:a,:b,:c,:d,:e,:f,:g,:h,:i,:j,:k,:l,:m,:n,:o,:p,:q)") ; $insert->bindparam("a",$fnames) ; $insert->bindparam("b",$regno) ; $insert->bindparam("c",$avata) ; $insert->bindparam("d",$admyear) ; $insert->bindparam("e",$gen) ; $insert->bindparam("f",$dob) ; $insert->bindparam("g",$address) ; $insert->bindparam("h",$deno) ; $insert->bindparam("i",$town) ; $insert->bindparam("j",$lga) ; $insert->bindparam("k",$states) ; $insert->bindparam("l",$nof) ; $insert->bindparam("m",$pof) ; $insert->bindparam("n",$pvs) ; $insert->bindparam("o",$pvc) ; $insert->bindparam("p",$prc) ; $insert->bindparam("q",$stphone) ; //$insert->bindparam("a",$fnames) ; if($insert->execute()) { $_SESSION['reg'] = $regno ; header("location: parent.php") ; } } } ?>