Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.