我正在尝试检查表单提交中的重复电子邮件。
我的 php 看起来像这样
$value = $_POST['name'];
$value2 = $_POST['email'];
$value3 = $_POST['address'];
$value4 = $_POST['city'];
$value5 = $_POST['state'];
$value6 = $_POST['zip'];
$value7 = $_POST['primary'];
$value8 = $_POST['secondary'];
$sql = "INSERT INTO fusiodoseOne (`name`, `email`, `address`, `city`, `state`, `zip`, `primary`, `secondary`) VALUES ('$value', '$value2', '$value3', '$value4', '$value5', '$value6', '$value7', '$value8')";
if(!mysql_query($sql)){
die('Error : ' . mysql_error());
}
//
function createUser($email){
$sql = "SELECT count(email) FROM fusiodoseOne WHERE email='$value2'" ;
$result = mysql_result(mysql_query($sql),0) ;
if( $result > 0 ){
die( "There is already a user with that email!" ) ;
}//end if
我究竟做错了什么。重复的电子邮件条目仍在处理中
jquery 看起来像这样
$.post("demo.php",$(this).serialize(),function(data){
$('.successMessageHolder').show();
$('.alertMsg').hide();
});