homepage Welcome to WebmasterWorld Guest from 54.242.200.172
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderators: physics

Databases Forum

    
Very simple Insert Error.don't see why it's not working
tec4




msg:4473353
 9:16 pm on Jul 6, 2012 (gmt 0)

So, no idea why this isn't working for me...

Code is as follows:

insert into test (unique,Bathrooms,Bedrooms,City,County,Number,Rid) values ('1','3.00','5.00','San Francisco','San Francisco','34','2729')

But, when I take out the "unique" and the "1" out of the key/values, as below, it works:

insert into test (Bathrooms,Bedrooms,City,County,Number,Rid) values ('3.00','5.00','San Francisco','San Francisco','34','2729')

The error:

#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 'unique,Bathrooms,Bedrooms,City,County,Number,Rid) values ('1',' at line 1

What am I overlooking?

Thanks for the help in advance.

 

wickydoodah




msg:4473363
 10:08 pm on Jul 6, 2012 (gmt 0)

I believe "unique" is a reserved word in MySQL.

tec4




msg:4473370
 10:33 pm on Jul 6, 2012 (gmt 0)

...and that was it...

Thanks for catching that - I had absolutely no idea...thought I was going crazy!

Thanks Wicky

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved