你看到什么问题了吗?我知道这个错误。
$col = 360;
$col1 = 350;
$esim = 0;
$esim1 = 1;
mysql_query("INSERT INTO my_table ($col, $col1) VALUES('$esim', '$esim1')") or die(mysql_error());您的SQL语法有错误;请检查与您的MySQL服务器版本对应的手册,以便在第1行使用接近'360,350‘值(’0‘,’1‘)的正确语法。
发布于 2014-01-14 14:53:43
我想你正遭受着和这里一样的问题:Can a number be used to name a MySQL table column?
将您的表名和列名放在后面。
发布于 2014-01-14 14:52:18
将“表”更改为table。“table”这个词是保留的。关于保留词的更多信息:https://drupal.org/node/141051
Identifiers may begin with a digit but unless quoted may not consist solely of digits.(http://dev.mysql.com/doc/refman/5.0/en/identifiers.html)
发布于 2014-01-14 14:55:26
试试这个..。
$col = "`360`";
$col1 = "`350`";
$esim = 0;
$esim1 = 1;
mysql_query("INSERT INTO my_table ($col, $col1) VALUES('$esim', '$esim1')") or die(mysql_error());如果列名是编号的,则应用括起来
https://stackoverflow.com/questions/21116462
复制相似问题