krishp76
krishp76

Reputation: 3

ERROR 1064 (42000) SQL Insert into

I have looked at a lot of other questions asked on this topic and still can not figure out what the error of my code is in SQL. I created a table called easy_drinks and when I try to insert one record it is giving me an error. Can someone please explain to me the error? Also, what is the best way to debug this kind of error in the future if I can't find out the issue?

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

I am running MySQL version 5.6.22

Upvotes: 0

Views: 3255

Answers (1)

Alex Pliutau
Alex Pliutau

Reputation: 21947

Replace your quotes from ` to '

Upvotes: 1

Related Questions