Jump to content

[SOLVED] I should have done this sooner, please help me : CREATE TABLE


Rebelrebellious

Recommended Posts

I have tried every reconfiguration of ' ` and " marks that I could imagine. This is only the latest failed attempt. What am I doing wrong?

 

The most frequent error I have been seeing is:

 

#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 'NULL,

`letsmeetfreetimeinminutes` INT NOT NULL,

`letsmeetupdateswitch` ENUM ( ' at line 7

 

I understand this is due to a conflict with the reserved words. I would like to stick with descriptive column names if it is possible.

Maybe the problem has to to with my use of ENUM, I really don't know. Please help.

 

CREATE TABLE letsmeet_Jesse__calendar 
(
`letsmeetdate` INT( 2 ) NOT NULL,
`letsmeetmonth` ENUM( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ) NOT NULL,
`letsmeetyear` INT NOT NULL,
`letsmeetdayname` ENUM ( 'Mon`day`', 'Tues`day`', 'Wednes`day`', 'Thurs`day`', 'Fri`day`', 'Satur`day`', 'Sun`day`' ) NOT NULL,
`letsmeeteventlist` VARCHAR NULL,
`letsmeetfreetimeinminutes` INT NOT NULL,
`letsmeetupdateswitch` ENUM ( 'onefoot', 'twofoot', 'threefoot' ) NULL,
`letsmeetupdatefootstep` INT NOT NULL,
`letsmeetprimarykey` INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY( `letsmeetprimarykey` )
)

 

 

And I just read that you will want this:

 

Server version: 5.0.45-community

Protocol version: 10

Server: Localhost via UNIX socket

I also wanted to add that the ENUM choices for the letsmeetupdateswitch column hould preferrably be simply Left or Right. If that in't possible, then I would like to use 0 or 1.

 

Also, the letsmeet prefix was somehing I added to try to get around this error. Aside from the table prefix I don't see any value in having the prefix on each of the columns. Thanks,

 

-Jesse

varchar can have a maximum of 256 characters.  the backticks are not needed, but can be left there, is is safe for using mysql reservered words.

 

Here is a reference of lengths if needed

 

char(size)  Holds a fixed length string (can contain letters, numbers, and special characters). The fixed size is specified in parenthesis

 

varchar(size) Holds a variable length string (can contain letters, numbers, and special characters). The maximum size is specified in parenthesis

 

tinytext Holds a variable string with a maximum length of 255 characters

 

text

blob Holds a variable string with a maximum length of 65535 characters

 

mediumtext

mediumblob Holds a variable string with a maximum length of 16777215 characters

 

longtext

longblob Holds a variable string with a maximum length of 4294967295 characters

Thank you very much. I really should have come here right away. Now I can get on with my project. :)

 

What type should I use if I want to have the option of storing really long lists of text? text files and such

 

Have a great day.

 

 

 

---update--- You must have been reading my mind.

varchar can have a maximum of 256 characters.  the backticks are not needed, but can be left there, is is safe for using mysql reservered words.

No longer -- in MySQL5, up to 65K.

 

Ok, I will have to update my reference sheet.  Thanks for the correction.

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.