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 Link to comment https://forums.phpfreaks.com/topic/280176-keep-getting-error-when-trying-to-upload-to-mysql-error-sql-query/ 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)? Link to comment https://forums.phpfreaks.com/topic/280176-keep-getting-error-when-trying-to-upload-to-mysql-error-sql-query/#findComment-1440805 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 Link to comment https://forums.phpfreaks.com/topic/280176-keep-getting-error-when-trying-to-upload-to-mysql-error-sql-query/#findComment-1440807 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. Link to comment https://forums.phpfreaks.com/topic/280176-keep-getting-error-when-trying-to-upload-to-mysql-error-sql-query/#findComment-1440811 Share on other sites More sharing options...
codelinx Posted July 15, 2013 Share Posted July 15, 2013 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...) Link to comment https://forums.phpfreaks.com/topic/280176-keep-getting-error-when-trying-to-upload-to-mysql-error-sql-query/#findComment-1440813 Share on other sites More sharing options...
codelinx Posted July 15, 2013 Share Posted July 15, 2013 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." Link to comment https://forums.phpfreaks.com/topic/280176-keep-getting-error-when-trying-to-upload-to-mysql-error-sql-query/#findComment-1440814 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 Link to comment https://forums.phpfreaks.com/topic/280176-keep-getting-error-when-trying-to-upload-to-mysql-error-sql-query/#findComment-1440855 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.