Не получаю в бд данные которые указываю при регистрации, не могу найти проблему вот весь код что есть. registration.php
<!DOCTYPE html>
<html>
<head>
<title>Registration Form Using jQuery - Demo Preview</title>
<meta name="robots" content="noindex, nofollow">
<!-- Include CSS File Here -->
<link rel="stylesheet" href="style.css"/>
<!-- Include JS File Here -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<div class="form">
<form autocomplete="off" id="myform">
<h2>Create Registration Form Using jQuery</h2>
<label>Name :</label>
<input type="text" name="name" id="name">
<label>Email :</label>
<input type="text" name="email" id="email">
<label>Password :</label>
<input type="password" name="password" id="password">
<input type="submit" name="register" id="login" value="login">
</form>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#myform").on('submit', function(e){
e.preventDefault();
$.ajax({
type: "POST",
url: "register.php",
data: new FormData(this),
dataType: "json",
contentType: false,
cashe: false,
processData: false,
success:function(response){
$(".form-message").css("display", "block");
if(response.status == 1){
$("#myform")[0].reset();
$(".form-message").html('<p>' + response.message + '</p>');
}else{
$(".form-message").css("display", "block");
$(".form-message").html('<p>' + response.message + '</p>');
}
}
});
});
});
</script>
</body>
</html>
register.php
<?php
$response = array ( 'status' => 0, 'message' => 'Fail');
$errorEmpty = false;
$errorEmail = false;
if(isset($_POST['name']) || isset($_POST['email']) || isset($_POST['password'])){
$name = $_POST['name'];
$email = $_POST['email'];
$password = $_POST['password'];
}
$hash = md5($password);
$check = "SELECT * FORM registration WHERE email = '$email'";
$r = mysqli_query($con, $check);
$query = "INSERT INTO registration (name,email,password) VALUES('$name' , '$email' , '$password')";
?>
config.php
<?php
$con = new mysqli('localhost','root','root','college');
$con->query("INSERT INTO `register` (`name` ,`email` ,`password`) VALUES('$name' , '$email' , '$password')");
$con->close();
?>