0

Can someone tell me what did I do wrong on this insert statement:

INSERT INTO inventory (typer, prodid, Description, Loc, Price, Total, Available) 
Values('Head', 'H001', 'KosMom - Blue', 'G:\Tesd\', '48.00', 5, 5);


inventory table:
uid - int - key
typer - varchar 255
prodid - varchar 255
Description - varchar 255
Loc - text
Price - text
Total - int
Available - int

Error when run the query:

INSERT INTO inventory (typer, prodid, Description, Loc, Price, Total, Available) 
Values('Head', 'H001', 'KosMom - Blue', 'G:\Tesd\', '48.00', 5, 5);
> 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 
'48.00', 5, 5)' at line 2
> Time: 0s
1
  • It's odd to store prices as text Commented Jun 28, 2020 at 11:20

1 Answer 1

2

Backslashes are escape characters. Try doubling them:

Values('Head', 'H001', 'KosMom - Blue', 'G:\\Tesd\\', '48.00', 5, 5);
Sign up to request clarification or add additional context in comments.

2 Comments

That worked. I didn’t think that would be the problem.
@JohnHang or use "

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.