SQL help, anyone?
One user was having trouble with my User Wall extension; it turned out to be an SQL error that occurred while it was creating its database table. The SQL used to do so is as follows:
CREATE TABLE `LUM_UserWall` (
`WallCommentID` int(8) NOT NULL auto_increment PRIMARY KEY,
`UserID` int(10) NOT NULL default '0',
`Date` datetime NOT NULL default '0000-00-00 00:00:00',
`FromUserID` int(10) NOT NULL default '0',
`Body` text NOT NULL default '',
`RemoteIp` varchar(100) default NULL,
KEY `UserID` (`UserID`)
);
Can anyone see any problems with this? For what it's worth, it says the error is near ';' at the end. And the extension seems to have worked fine for everyone else (or, at least, nobody else has reported this problem to me). 0
This discussion has been closed.
Comments
Date
is reserved in MySQL and a user can't use it... give the row name "Thedate" or "curdate", or something other than simply "Date"... but im no mysql expert either, only i remember that i had problems when i entitled a rowdesc
(short fordescription
) and the server thought it was a reserveddesc
(short ofdescend
)... hope this helpsNotice though that an export statement defines the table "type". In case the default is not MyISAM this could be significant.
CREATE TABLE `LUM_UserWall` ( `WallCommentID` int(8) NOT NULL auto_increment, `UserID` int(10) NOT NULL default '0', `Date` datetime NOT NULL default '0000-00-00 00:00:00', `FromUserID` int(10) NOT NULL default '0', `Body` text NOT NULL, `RemoteIp` varchar(100) default NULL, PRIMARY KEY (`WallCommentID`), KEY `UserID` (`UserID`) ) TYPE=MyISAM AUTO_INCREMENT=1 ;