I have created the following PHP script which works perfectly - sends name, phone and email to a mySQL database.
What I need to do it somewhere put in a command that checks the Database for duplicate email entries - The email sends out discount details for the shop so we only want to send one per email address. Is this possible? How would I go about doing this?
$name=$_POST['requiredname']; $phone=$_POST['requiredphone']; $email=$_POST['requiredemail']; $from = "email@example.com"; $subject = "Hair Kandi Discount Voucher"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query = "INSERT INTO contacts VALUES ('','$name','$phone','$email')"; mysql_query($query); //begin message $message = <<<EOF <html> <body bgcolor="#333333">