我如何使下面的代码工作!这是与db.Whene的连接用户尝试注册我想显示错误,如果他们的电子邮件输入存在尝试另一个但如果不是那么你注册了!
$query = "SELECT * FROM `TesteExample` WHERE Email_address = '".mysqli_real_escape_string($link,$_POST['email_address'])."'";
$resultQuery = mysqli_query($link,$query);
$resultsQuery = mysqli_num_rows($resultQuery);
//We test if the email the user tries is already registered.If it is then we tell him to create one.
if($resultsQuery) {
$AlreadyExists = "There is already a user with this email address.Please try another one.";
} else {
$query = "INSERT INTO `TesteExample`
(`Name`, `Surname`, `Email_address`, `Password`, `Gender`, `Comment`, `Country`, `ListOfDates`, `ListOfMonths`, `ListOfYears`, `Website`)
VALUES ('".$_POST['name']."','".$_POST['surname']."','".mysqli_real_escape_string($link,$_POST['email_address'])."','".$_POST['password']."','".$_POST['gender']."','".$_POST['comment']."','".$_POST['country']."','".$_POST['listOfDates']."','".$_POST['listOfMonths']."','".$_POST['listOfYears']."','".$_POST['website']."')";
mysqli_query = ($link,$query);
Notitce是我注释掉else语句一切正常。但是如果我包含它整个页面都不起作用.. 我想让你知道,其中一些像(国家)是下拉列表中的数据或(性别)是一个单选按钮。我是否必须在INSERT INTO ????
中指定其他内容