Phil (flameswithin) wrote in mysql,

  • Mood:
  • Music:

insert + enum

hey everyone, my name is Phil. i started learning PHP in september and about a month ago started learning mysql and how the two work together.

i have a question regarding the enum data type. any time i try to create a table which has a field which i'd like to specify as enum, i get a syntax error. i've checked the manual and am not sure what i'm doing wrong. here's an example:

create table records(record_id int auto_increment, user varchar(50) not null, status enum("open","closed"), primary key(record_id));

what i've ended up having to do is create the first half of the table, then put in each of the enum fields one at a time, then do the rest. could someone tell me what i'm doing wrong?

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.