I get the error "Warning: mysqli_close() expects parameter 1 to be mysqli, null given in" and I can't find a problem. Can anyone help, here is my code.
$username = $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email'];
$CheckSQL = "SELECT * FROM users WHERE email='$email'";
$check = mysqli_fetch_array(mysqli_query($con,$CheckSQL));
if(isset($check)){
echo 'Email Already Exist';
}
else{
$Sql_Query = "INSERT INTO users (username,password,email) values ('$username','$password','$email')";
if(mysqli_query($con,$Sql_Query))
{
echo 'Registration Successfully';
}
else
{
echo 'Something went wrong';
}
}
}
mysqli_close($con);