0
我在上个小时试图解决这个问题。我有一个很长的形式,我试图将信息上传到MySQL数据库。进入我制作的桌子。这是我使用的MySQL查询:查询Mysql的麻烦:上传
mysql_query("INSERT INTO `users_temp`(`first_name`, `surname`, `birthday`, `nationality`, `email`, `mobile`, `landline`, `address`, `town`, `post_code`, `country`, `password`, `code_conf`) VALUES ([$f_name],[$s_name],[$bday],[$nationality],[$email],[$mobile],[$landline],[$address],[$town],[$post_code],[$country],[$pass],[$conf_code])");
如果有人看到任何问题,为什么它不起作用请让我知道。谢谢...
$f_name = $_POST["f_name"];
$s_name = $_POST["s_name"];
$pass = $_POST["pass"];
$birthday = $_POST["bday"];
$nationality = $_POST["nationality"];
$email = $_POST["email"];
$mobile = $_POST["mobile"];
$landline = $_POST["landline"];
$address = $_POST["address"];
$town = $_POST["town"];
$post_code = $_POST["post_code"];
$country = $_POST["country"];
$conf_code = substr(md5(uniqid(rand(), true)), 1, 70);
include("connect_into_mysql.php");
mysql_select_db("jzperson_edu", $conn);
$res_01 = mysql_query("SELECT * FROM users WHERE email='$email'");
$count_01 = mysql_num_rows($res_01);
if($count_01==0)
{
mysql_query("INSERT INTO users_temp ('first_name','surname','birthday','nationality','email','mobile','landline','address','town','post_code','country','password','code_conf') VALUES ('$f_name','$s_name','$bday','$nationality','$email','$mobile','$landline','$address','$town','$post_code','$country','$pass','$conf_code')");
header("Location: home.php");
}else{echo "This email is already registered. If you lost your password you can reset it here.";}
你有什么错误吗?你是否清理了你放入数据库的变量? ps,你可以使用'{$ varname}'或''。$ varname。',而不是'[$ varname]' –
我会把整个代码置于问题中。我正在编辑它。 –
什么是确切的错误信息?并请删除方括号[]并再次尝试。你现在有什么错误信息? –