Hi all,
Im at a loss here. There are definitly a lot of emails repeated in the table, but it just wont echo out anything.
all help is appreciated
Im at a loss here. There are definitly a lot of emails repeated in the table, but it just wont echo out anything.
all help is appreciated
Code:
<?php
session_start();
include "connect.php";
$name = $_SESSION['name'];
$email = $_SESSION['email'];
$nationality = $_SESSION['country'];
$query = "SELECT * FROM tbl_beta WHERE email =' $email'" or die(mysql_error());
$result = mysql_query($query);
$unique = mysql_num_rows($result);
if($unique > 1){
echo "Sorry, That email has already been registered in out database. Please contact support at ";
exit();
}else{
$SQL = "INSERT INTO tbl_beta (name, email, nationality) VALUES ('$name', '$email', '$nationality')";
$result = mysql_db_query($db,$SQL,$cid);
echo "Thanks for registering " . $name;
echo "<br>We will be in touch shortly.";
$_SESSION['betaemail'] = $email;
include "mail.php";
}
?>
Comment