您的 SQL 语法有误 - 靠近 'left)

You have an error in your SQL syntax - near 'left)

我是 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 是一个保留字,在查询中你需要使用 backtics

进行转义
`left`

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

$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)";

left 是一个保留字,在查询中您需要像这样使用所有保留字 'left'

这给出了有关保留字的所有详细信息https://dev.mysql.com/doc/refman/5.5/en/reserved-words.html

left 是 mysql 保留字。所以你必须重命名列 left.

请参阅此处:reserved Words 了解更多信息