Click to See Complete Forum and Search --> : Can't seem to insert into


Pembar
07-13-2009, 04:19 AM
Ugh, sorry guys, I've been looking at it the past 5 mins trying everything but I can't seem to insert this record into the table.

INSERT INTO history (username,index) VALUES ('john','0')

Also tried
INSERT INTO history (username,index) VALUES ('john',0)


Tablename: history
username: Varchar of length 20
index: int of length 1

Edit: Didn't realise 'index' was a sql keyword.

NogDog
07-13-2009, 07:47 AM
Assuming MySQL, quoting the column name with back-quotes as `index` should take care of the reserved word issue.