mysql query - syntax error - cannot find out why

Posted by Phil Jackson on Stack Overflow See other posts from Stack Overflow or by Phil Jackson
Published on 2010-04-11T08:29:49Z Indexed on 2010/04/11 8:33 UTC
Read the original article Hit count: 269

Filed under:
|
|

Hi all, im taring my hair out over this one. A query is throwing an 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 'FROM, SUBJECT, DATE, READ, MAIL ) VALUES ( 'EJackson', 'dfdf', '1270974101', 'fa' at line 1

I printed out the query to see what could be the problem:

INSERT INTO db.tablename ( FROM, SUBJECT, DATE, READ, MAIL ) VALUES ( 'EJackson', 'dfdf', '1270974299', 'false', 'dfdsfdsfd' )

and finaly the structure consists of:

CREATE TABLE db.tablename (
  `ID` int(12) NOT NULL auto_increment,
  `FROM` varchar(255) NOT NULL,
  `SUBJECT` varchar(255) NOT NULL,
  `DATE` varchar(255) NOT NULL,
  `READ` varchar(255) NOT NULL,
  `MAIL` varchar(255) NOT NULL,
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

I cant find anything wrong. Any Help would be much appreciated.

( db.tablename is a replacement for the actual tablename )

© Stack Overflow or respective owner

Related posts about mysql

Related posts about syntax