query("SELECT * FROM students where mobile = '".$_POST['mobile']."' AND email = '".$_POST['email']."'"); if(!($chk->num_rows)) { $img = photo_upload('image','students'); if($img['status']){ $image = $img['file_name']; }else{ $image= ''; } $signature = photo_upload('sign','students'); if($signature['status']){ $sign = $signature['file_name']; } else{ $sign = ''; } $data = $con->query("INSERT INTO `students` (`dur_start`,`dur_ends`,`id`, `timestamp`, `enrollment_no`, `name`, `gender`, `father`, `mother`, `dob`, `mobile`, `email`,`address`, `state`, `distric`, `exam_pass`, `marks`, `board`, `year`, `username`, `password`, `course_id`, `center_id`, `photo`,`sign`, `status`) VALUES ('".$_POST['dur_start']."','".$_POST['dur_ends']."',NULL, CURRENT_TIMESTAMP, '".student_last_id()."', '".$_POST['name']."', '".$_POST['gender']."', '".$_POST['father']."', '".$_POST['mother']."', '".$_POST['dob']."', '".$_POST['mobile']."', '".$_POST['email']."', '".$_POST['address']."','".$_POST['state']."', '".$_POST['distric']."', '".$_POST['exam_pass']."', '".$_POST['marks']."', '".$_POST['board']."', '".$_POST['year']."', '".$_POST['username']."', '".$_POST['password']."', '".$_POST['course_id']."', '".$_POST['center_id']."', '".$image."','".$sign."', '0')"); // var_dump($data); // exit; $id = mysqli_insert_id($con); echo ''; } else{ echo 'Not Submitted'; } } ?>