1

This is 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 'case='nominative' WHERE id='42'' at line 1

This is the query:

UPDATE `ruen_kw` SET case='nominative' WHERE id='42'

The table:

CREATE TABLE `ruen_kw` (
  `id` tinyint(6) NOT NULL auto_increment,
  `language` varchar(2) NOT NULL,
  `keyword` varchar(80) character set utf8 NOT NULL,
  `translation` varchar(300) NOT NULL,
  `case` varchar(50) NOT NULL,
  `tense` varchar(50) NOT NULL,
  `gender` varchar(25) NOT NULL,
  `number` varchar(50) NOT NULL,
  `definition` varchar(200) character set utf8 NOT NULL,
  PRIMARY KEY  (`id`),
  FULLTEXT KEY `keyword_2` (`keyword`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=46 ;

The line to be updated:

INSERT INTO ruen_kw (id, language, keyword, translation, case, tense, gender, number, definition) VALUES (42, 'ru', 'хозÑйка', 'hostess', 'nom', '', '', '', '');

Jocelyn
  • 11,209
  • 10
  • 43
  • 60
Lawrence DeSouza
  • 984
  • 5
  • 16
  • 34

1 Answers1

2

"case" is a reserved word in MySQL. From the MySQL Documentation:

Reserved words are permitted as identifiers if you quote them as described in Section 9.2, “Schema Object Names”:

Try this, instead:

 UPDATE ruen_kw SET `case`='nominative' WHERE id='42';
Aaron
  • 55,518
  • 11
  • 116
  • 132