How check username and email already exists in php . Below is what I am using-
$first = $_POST[‘first’];
$last = $_POST[‘last’];
$email = $_POST[‘email’];
$message = $_POST[‘message’];
date_default_timezone_set(‘Asia/Kolkata’);
$date=date(“d/m/Y h:i:sa”);
$sql = “INSERT INTO request (first,last,email,message,dt)
VALUES(’$first’,’$last’,’$email’,’$message’,’$date’)”;
if (mysqli_query($db, $sql)) {
echo “Request sent Sucessfully”;
header ("Location: thankyou.html");
} else {
echo "Error: " . $sql . “
” . mysqli_error($db);
}
mysqli_close($db);
Any help please
Gary