我正在尝试为用户创建一个简单的插入语句......但它出错了......我只尝试了值并且它有效,它必须与我在插入语句中处理数组的方式有关?
有任何想法吗?
if ($new_user_data) {
$mysqli->query("INSERT INTO users (user_name, user_year, user_sex, user_pic, user_level, user_password, user_email)
VALUES ( ". $new_user_data['user_name'] .",". $new_user_data['user_year'] .",". $new_user_data['user_sex'] .",". $new_user_data['user_pic'] .",1,". $new_user_data['user_password'] .",". $new_user_data['user_email'] ." )");
print_r($mysqli->error);
}
错误:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@gmail.coms )' at line 2