我的代码不断出现以下错误:
#1064 - 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 'INSERT INTO tags (
id
,name
) VALUES (1, 'Web Design')' at line 2
我正在 phpMyAdmin 上运行代码。这是代码:
USE home_blog
INSERT INTO tags (`id`, `name`)
VALUES (1, 'Web Design');
id 是 int,name 是 varchar。我发现了类似的问题,但它们都通过保留字问题或缺少括号来修复。除非我完全失明,否则我不会遇到这些问题。
最佳答案
USE
和 INSERT
是 2 个不同的语句,就像 2 个查询一样。需要写“;”如果您想在行中执行它们,请在所有语句的最后。
关于mysql - phpMyAdmin 上的 SQL INSERT INTO 错误 #1064,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29926449/