Forum Moderators: open

Message Too Old, No Replies

sql table creation not working with mysql version

         

leoo24

12:27 pm on Apr 21, 2006 (gmt 0)

10+ Year Member



hey guys :)

i bought a database in sql dump format, when i go to create the database i get a sql syntax error, my mysql version is 4.0.25, here is the error i get and the table sql, any help would be greatly appreciated


CREATE TABLE `articles` (
`FileID` int( 3 ) unsigned NOT NULL AUTO_INCREMENT ,
`Title` varchar( 50 ) NOT NULL default '',
`Author` varchar( 50 ) NOT NULL default 'Andy Grayndler',
`Category` varchar( 50 ) default '',
`Keywords` varchar( 80 ) default NULL ,
`Articledata` longtext,
`Approved` char( 1 ) default 'N',
`Views` int( 10 ) default '0',
`SubmitDate` timestamp NOT NULL default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
`Votes` int( 16 ) NOT NULL default '0',
`Score` int( 16 ) NOT NULL default '0',
PRIMARY KEY ( `FileID` ) ,
KEY `Keywords` ( `Keywords` )
) ENGINE = MYISAM DEFAULT CHARSET = latin1

MySQL said: Documentation
#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 'CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`Votes` int(1

zCat

10:33 am on Apr 23, 2006 (gmt 0)

10+ Year Member



Remove the "ON UPDATE CURRENT_TIMESTAMP" from the definition, and change "ENGINE=MYISAM" to "TYPE=MYISAM".

leoo24

1:12 pm on Apr 24, 2006 (gmt 0)

10+ Year Member



hi zcat,

thanks for the response, but still got the same 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 'CURRENT_TIMESTAMP ,
`Votes` int(16) NOT NULL default '0',