John Hang
John Hang

Reputation: 125

MySQL - Issue with running the INSERT INTO query

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

Upvotes: 0

Views: 36

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1271003

Backslashes are escape characters. Try doubling them:

Values('Head', 'H001', 'KosMom - Blue', 'G:\\Tesd\\', '48.00', 5, 5);

Upvotes: 2

Related Questions