<分区>
这个问题不太可能帮助任何 future 的访问者;它只与一个小的地理区域、一个特定的时间点或一个非常狭窄的情况相关,这些情况并不普遍适用于互联网的全局受众。为了帮助使这个问题更广泛地适用,visit the help center .
关闭 10 年前 。
我正在尝试将数据保存到数据库;我正在使用的查询是
$sql_query = 'UPDATE ' . 'config' . ' SET current_email = "' . $_POST["an email_data"] . '"';
在这种情况下突破到
UPDATE config SET current_email = 'email address'
我不断收到 mysql 错误 1054,“field_list”中的未知列“current_email”
我已尝试重新键入查询和数据库字段,但无济于事。他的专栏确实存在。
我有 5.4.3 版的 mySql。我以前从来没有遇到过这个问题,我束手无策。我已经死在水里三天了知道。如果有任何帮助,我将不胜感激。
谢谢
在您的第一行中,您为 SQL 字符串使用了双引号:SET current_email = " '
这将呈现为:
更新配置 SET current_email = "email address"
改为尝试单引号:
UPDATE config SET current_email = 'email address'
参见:
http://dev.mysql.com/doc/refman/5.1/en/string-literals.html
If the ANSI_QUOTES SQL mode is enabled, string literals can be quoted
only within single quotation marks because a string quoted within
double quotation marks is interpreted as an identifier.