为什么mySQL缺少一个列?

时间:2011-04-12 16:15:33

标签: mysql

此语句未填充image_path列。我已经从phpMyAdmin复制并粘贴了列名,以确保准确性。

INSERT INTO (theme_name, theme_path, image_path)
VALUES ('',
        '/Applications/MAMP/htdocs/waggleb/wp-content/plugins/app-switcher/themes/Original/',
        '/Applications/MAMP/htdocs/waggleb/wp-content/plugins/app-switcher/thumbnails/original.png')

5 个答案:

答案 0 :(得分:3)

你错过了一个表名。如果查看MySQL INSERT syntax,您会发现必须包含表名。

因此,如果您将查询更改为..

INSERT INTO <TABLE NAME> (theme_name, theme_path, image_path) VALUES...

......一切都应该好。

答案 1 :(得分:3)

你错过了表名

INSERT INTO  TABLENAME(theme_name, theme_path, image_path)
VALUES ('',
        '/Applications/MAMP/htdocs/waggleb/wp-content/plugins/app-switcher/themes/Original/',
        '/Applications/MAMP/htdocs/waggleb/wp-content/plugins/app-switcher/thumbnails/original.png')

答案 2 :(得分:1)

我相信你错过了表名。

应该是:

插入[Table_name] ([列]) 值([值])

答案 3 :(得分:1)

您忘记将表命名为INSERT:

INSERT INTO my_table (theme_name, theme_path, image_path)

答案 4 :(得分:1)

如果您故意省略了表名,请检查列的数据类型是否正确。检查目标列的长度足以保存您要插入的内容。