TimUSA Posted December 30, 2007 Share Posted December 30, 2007 i tried running this query CREATE TABLE ladder_points ( memberName varchar(20) primary key, date date(yyyy-mm-dd), factor int(20), racePoints decimal(10000,2), matchPoints decimal(10000,2), fleetPoints decimal(10000,2), ) and got this message? Error SQL query: CREATE TABLE ladder_points( memberName varchar( 20 ) PRIMARY KEY , datedate( yyyy - mm - dd ) , factor int( 20 ) , racePoints decimal( 10000, 2 ) , matchPoints decimal( 10000, 2 ) , fleetPoints decimal( 10000, 2 ) , ) 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 '(yyyy-mm-dd), factor int(20), racePoints decimal(10000,2), matchPoints decima' at line 4 can someone help please? MySQL client version: 4.1.22 Quote Link to comment https://forums.phpfreaks.com/topic/83759-solved-mysql-help/ Share on other sites More sharing options...
papaface Posted December 30, 2007 Share Posted December 30, 2007 Shouldn't it just be date(y-m-d) Quote Link to comment https://forums.phpfreaks.com/topic/83759-solved-mysql-help/#findComment-426160 Share on other sites More sharing options...
TimUSA Posted December 30, 2007 Author Share Posted December 30, 2007 fixed that and now am getting CREATE TABLE ladder_points( memberName varchar( 20 ) PRIMARY KEY , datedate( y - m - d ) , factor int( 20 ) , racePoints decimal( 10000, 2 ) , matchPoints decimal( 10000, 2 ) , fleetPoints decimal( 10000, 2 ) , ) 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 '(y-m-d), factor int(20), racePoints decimal(10000,2), matchPoints decimal(100' at line 4 Quote Link to comment https://forums.phpfreaks.com/topic/83759-solved-mysql-help/#findComment-426163 Share on other sites More sharing options...
revraz Posted December 30, 2007 Share Posted December 30, 2007 Try using another field name instead of Date. And if you don't have to specify a format, a mysql date is always in it's own format. Quote Link to comment https://forums.phpfreaks.com/topic/83759-solved-mysql-help/#findComment-426167 Share on other sites More sharing options...
papaface Posted December 30, 2007 Share Posted December 30, 2007 you have datedate(y-m-d) instead of: `date` date(y-m-d) Quote Link to comment https://forums.phpfreaks.com/topic/83759-solved-mysql-help/#findComment-426169 Share on other sites More sharing options...
PFMaBiSmAd Posted December 30, 2007 Share Posted December 30, 2007 So, check the manual like the error message states. The problem is that a DATE data type has no parameters and you are attempting to specific a parameter. Quote Link to comment https://forums.phpfreaks.com/topic/83759-solved-mysql-help/#findComment-426173 Share on other sites More sharing options...
Barand Posted December 30, 2007 Share Posted December 30, 2007 No, just "date" and the last comma should be removed. Also a bit optimistic to have ints with 20 digits and decimal numbers with 10000 digits. Also it's better not to use reserved words such as "date" for column names CREATE TABLE ladder_points ( memberName varchar(20) NOT NULL primary key, joinDate date, factor int, racePoints decimal(10,2), matchPoints decimal(10,2), fleetPoints decimal(10,2) ) Quote Link to comment https://forums.phpfreaks.com/topic/83759-solved-mysql-help/#findComment-426174 Share on other sites More sharing options...
TimUSA Posted December 30, 2007 Author Share Posted December 30, 2007 through resolving one error at a time this is solved....thank you all for your help Quote Link to comment https://forums.phpfreaks.com/topic/83759-solved-mysql-help/#findComment-426176 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.