Skip to content
Advertisement

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

Advertisement

Answer

Backslashes are escape characters. Try doubling them:

Values('Head', 'H001', 'KosMom - Blue', 'G:\Tesd\', '48.00', 5, 5);
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement