Jump to content

Archived

This topic is now archived and is closed to further replies.

thndr

Insert INTO not working

Recommended Posts

Hello again,
Small problem.
[code]INSERT INTO trans (Amount,Desc,Date,Empty) VALUES('5.95','Fees','02.01.06','W')[/code]
it returns:
[code]Query failed : 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 'Desc,Date,Empty) VALUES('5.95','Fees','02.01.06','W')[/code]
Thats not working, what did I miss? The first field in the DB structure is ID, and i moved servers, I used to just use "INSERT INTO trans VALUES ('','price') etc, but it doesnt allow that for the ID field on new server so Im trying to do it the other way and its not working. TIA.
John

Share this post


Link to post
Share on other sites
DESC is a reserved word (DATE should be too but mysql allows it). Try this:

[code]
INSERT INTO trans (Amount,`Desc`,Date,Empty) VALUES('5.95','Fees','02.01.06','W')
[/code]

Share this post


Link to post
Share on other sites
DATE is reserved, but only for CREATE/ALTER TABLE statements. Still, no need to use it.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.