Jump to content

keep getting error when trying to upload to mysql Error SQL query


fastz28

Recommended Posts

Error

SQL query:

#

# Table structure for table `message`

#

CREATE TABLE `message` (

`messageid` int( 11 ) NOT NULL AUTO_INCREMENT ,

`isread` char( 1 ) NOT NULL default '0',

`lockstatus` char( 1 ) NOT NULL default '0',

`message` longtext,

`sender` varchar( 50 ) NOT NULL default '',

`recipient` varchar( 50 ) NOT NULL default '',

`date` timestamp( 14 ) NOT NULL ,

PRIMARY KEY ( `messageid` ) ,

KEY `sender` ( `sender` ) ,

KEY `recipient` ( `recipient` ) ,

KEY `readstatus` ( `recipient` , `isread` )

) ENGINE = MYISAM AUTO_INCREMENT =5;

 

MySQL said: b_help.png

#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 '(14) NOT NULL,

  PRIMARY KEY  (`messageid`),

  KEY `sender` (`sender`),

  KEY' at line 12

Look here as well...

http://dev.mysql.com/doc/refman/5.7/en/timestamp-initialization.html

 

 

From:

http://dev.mysql.com/doc/refman/5.7/en/date-and-time-literals.html

 

"String and Numeric Literals in Date and Time Context.

...

As a string in either 'YYYY-MM-DD HH:MM:SS' or 'YY-MM-DD HH:MM:SS' format. A relaxed syntax is permitted here, too: Any punctuation character may be used as the delimiter between date parts or time parts. For example,'2012-12-31 11:30:45''2012^12^31 11+30+45''2012/12/31 11*30*45', and '2012@12@31 11^30^45' are equivalent."

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.