Jump to content


Photo

query problem


  • Please log in to reply
2 replies to this topic

#1 malbolgia

malbolgia
  • Members
  • Pip
  • Newbie
  • 5 posts

Posted 26 April 2006 - 09:00 PM

im trying this query
INSERT INTO character (charname, charborn, charqual, id) VALUES ('Snoopy', '2006-10-08', 'cool', 'Snoopy');

and i get this error

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 'character (charname, charborn, charqual, id) VALUES ('Snoopy', '

i cant seem to see whats wrong

this is the table structure
id varchar(50)
charname varchar(60)
charborn date
charqual varchar(60)

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 26 April 2006 - 09:16 PM

[a href=\"http://htmlite.com/mysql002a.php\" target=\"_blank\"]http://htmlite.com/mysql002a.php[/a] - CHARACTER is a MySQL reserved word and I bet you can't use reserved words for table names. Change the table name to something else and see.
Legend has it that reading the manual never killed anyone.
My site

#3 malbolgia

malbolgia
  • Members
  • Pip
  • Newbie
  • 5 posts

Posted 26 April 2006 - 09:19 PM

thanks didnt know it was a reserved word :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users