Jump to content

new to mySQL and need help


thrash-boy

Recommended Posts

im very new to the whole mySQL thing (well ive tried it before, but forgot everything lol).

 

[hide=this is what im making (not vital to read)]im trying to create a thing where you enter your codes in flash, it splits them up into the separte bits, gets what each separate bit stands for from the database (through php), and then tells you everything it can about your Holden from the build plate codes.

 

I chose flash because im very familiar with it, and it saves learning something else.

 

I chose to use a database instead of just saving the codes in the flash file because 1. its more challenging and fun to do lol, 2. there are quite a few codes (so i wouldn't want them sitting there in flash taking up memory), and 3. i want to be able to add to/edit the list of codes at any time without making a new swf file.[/hide]

 

anyway to start off im making a table in PHP to store all the engine/trans/diff ratio codes.

 

here is the part of the PHP to make the 1st table:

 

[hide=the bit with the problem]

mysql_query(

"CREATE TABLE ENG(

id INT NOT NULL AUTO_INCREMENT,

value VARCHAR(3) NOT NULL,

desc VARCHAR(35) NOT NULL,

modHQ ENUM('t', 'f', 'u') DEFAULT 'u',

modHJ ENUM('t', 'f', 'u') DEFAULT 'u',

modHX ENUM('t', 'f', 'u') DEFAULT 'u',

modHZ ENUM('t', 'f', 'u') DEFAULT 'u',

modWB ENUM('t', 'f', 'u') DEFAULT 'u',

PRIMARY KEY(id)

)"

) or die (mysql_error());

 

id = unique ID for that code

 

value = what the code actually is

 

desc = what the code means

 

mod+[HQ-WB] = 5 different values that mean either true, false or unknown. (to say if it was, wasnt or it is unknown if it was available on that model)[/hide]

 

and here is what error it returns when i run the complete php page

 

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 'desc VARCHAR(35) NOT NULL, modHQ ENUM('t', 'f', 'u') DEFAULT 'u', modHJ ENUM' at line 4

 

 

 

im guessing it something to do with the enum but i cant for the life of me work out what iev done wrong.

 

thanks in advance :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.