Jump to content

[SOLVED] mysql help


TimUSA

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/83759-solved-mysql-help/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/83759-solved-mysql-help/#findComment-426163
Share on other sites

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)
)

Link to comment
https://forums.phpfreaks.com/topic/83759-solved-mysql-help/#findComment-426174
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.