gpt4 book ai didi

php - 您的 SQL 语法有误 - 靠近“左”)

转载 作者:行者123 更新时间:2023-12-01 00:42:18 28 4
gpt4 key购买 nike

我是 php 编程的新手。

我想应用插入查询,但出现此错误:

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 'left) VALUES ('****df','****2135gh','***@yahoo.com' at line 2"}

$sql_insert_new_user = "insert into users (username,password,email,status,finance,province,city,address,tell,
mobile,admin_seen,type,left) VALUES ('$username','$password','$email',1,0,$town,$city,
'$address','$telephone','$mobile',0,'employe',0)";

mysql_query($sql_insert_new_user);
$error = mysql_error();

最佳答案

left 是一个保留字,在查询中你需要用反义词转义

`left`

https://dev.mysql.com/doc/refman/5.5/en/reserved-words.html

关于php - 您的 SQL 语法有误 - 靠近“左”),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29386566/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com