gpt4 book ai didi

mysql - 错误 1064 (42000) SQL 插入

转载 作者:行者123 更新时间:2023-11-29 23:08:32 25 4
gpt4 key购买 nike

我已经查看了关于这个主题的很多其他问题,但仍然无法弄清楚我的代码在 SQL 中的错误是什么。我创建了一个名为 easy_drinks 的表,当我尝试插入一条记录时,它给了我一个错误。有人可以向我解释一下这个错误吗?另外,如果我找不到问题,将来调试此类错误的最佳方法是什么?

mysql> DESC easy_drinks;
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| drink_name | varchar(40) | NO | | NULL | |
| main | varchar(20) | NO | | NULL | |
| amount1 | decimal(4,2) | NO | | NULL | |
| second | varchar(20) | NO | | NULL | |
| amount2 | decimal(4,2) | NO | | NULL | |
| directions | blob | NO | | NULL | |
+------------+--------------+------+-----+---------+-------+
6 rows in set (0.00 sec)

mysql> INSERT INTO easy_drinks (drink_name, main, amount1, second, amount2, directions) VALUES (‘Blackthorn’, ‘tonic water’, 1.5, ‘pineapple juice’, 1, ‘stir with ice, strain into cocktail glass with lemon twist’);

ERROR 1064 (42000): 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 'water’, 1.5, ‘pineapple juice’, 1, ‘stir with ice, strain into c' at line 1

我正在运行 MySQL 版本 5.6.22

最佳答案

将引号从 ` 替换为 '

关于mysql - 错误 1064 (42000) SQL 插入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28183697/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com