Rebelrebellious Posted May 13, 2008 Share Posted May 13, 2008 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 Quote Link to comment Share on other sites More sharing options...
Rebelrebellious Posted May 13, 2008 Author Share Posted May 13, 2008 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 Quote Link to comment Share on other sites More sharing options...
peranha Posted May 13, 2008 Share Posted May 13, 2008 This line `letsmeeteventlist` VARCHAR NULL, has to have a value EX. VARCHAR(150) NULL, Quote Link to comment Share on other sites More sharing options...
Rebelrebellious Posted May 13, 2008 Author Share Posted May 13, 2008 Wow. ... Thank you. Is there any recommended maximum for the VARCHAR? Do I need to keep the ` marks as I have them? Quote Link to comment Share on other sites More sharing options...
peranha Posted May 13, 2008 Share Posted May 13, 2008 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 Quote Link to comment Share on other sites More sharing options...
Rebelrebellious Posted May 13, 2008 Author Share Posted May 13, 2008 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. Quote Link to comment Share on other sites More sharing options...
peranha Posted May 13, 2008 Share Posted May 13, 2008 it depends on the size of the file, medium is like 1 gig files, long is 4 gig, text and blob are about 65 megs I believe. Quote Link to comment Share on other sites More sharing options...
fenway Posted May 13, 2008 Share Posted May 13, 2008 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. Quote Link to comment Share on other sites More sharing options...
peranha Posted May 14, 2008 Share Posted May 14, 2008 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. Quote Link to comment 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.