fastz28 Posted July 15, 2013 Share Posted July 15, 2013 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: #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 Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted July 15, 2013 Share Posted July 15, 2013 May be other problems, but I'm pretty sure TIMESTAMP is a fixed length. Whats with the (14)? Quote Link to comment Share on other sites More sharing options...
fastz28 Posted July 15, 2013 Author Share Posted July 15, 2013 thank you for your quick response ill try removing that im a NEWBIE with all caps to php i got alot of new premade scripts im trying to learn Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted July 15, 2013 Share Posted July 15, 2013 It appears that you can add lengths to TIMESTAMP. Most likely something after that. Quote Link to comment Share on other sites More sharing options...
codelinx Posted July 15, 2013 Share Posted July 15, 2013 (edited) try replacing: `date` timestamp( 14 ) NOT NULL with `date` timestamp NOT NULL or try `date` timestamp AS 'MM/DD/YYYY' NOT NULL (put in whatever you want... im not playing with SQL atm, but try those...) Edited July 15, 2013 by codelinx Quote Link to comment Share on other sites More sharing options...
codelinx Posted July 15, 2013 Share Posted July 15, 2013 (edited) 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." Edited July 15, 2013 by codelinx Quote Link to comment Share on other sites More sharing options...
fastz28 Posted July 16, 2013 Author Share Posted July 16, 2013 ok removing the 14 worked i got my site set up but every link i click on on the main page it keeps sending me back to the index or main page Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.