您的SQL语法有错误;检查与MySQL服务器版本对应的手册,以便在' =
附近使用正确的语法$_email= $connection-> real_escape_string("abc@yahoo.com");
$checkSql = "SELECT * ";
$checkSql .= "FROM customer_registration";
$checkSql .= "WHERE ";
$checkSql .= "EMAIL=" . $_email ;
$result = $connection-> query($checkSql);
上面的php / mysql查询中的SELECT语句中出现了什么错误?
答案 0 :(得分:0)
$checkSql = "SELECT * ";
$checkSql .= "FROM customer_registration ";
$checkSql .= "WHERE ";
$checkSql .= "EMAIL LIKE '" . $_email ."'";
$result = $connection-> query($checkSql);
在您的代码中使用EMAIL = ".$_email;
这是错误的,至少用单引号包装$ _eamil
$checkSql .= "EMAIL='" . $_email."'" ;
答案 1 :(得分:0)
$checkSql .= "Email = \"$_email\"";
答案 2 :(得分:0)
$checkSql = "SELECT * ";
$checkSql .= "FROM `customer_registration`";
$checkSql .= "WHERE `EMAIL` = ". "'{$_email}' ";
$result = $connection-> query($checkSql);
部分答案在这里: -
Error in your SQL syntax; check the manual that corresponds to your MySQL server version