0

code picture with an error #1064 SQL query:

CREATE TABLE `simzsy`.`membership` (

`memberid` INT NOT NULL ,
`name` TEXT NOT NULL ,
`surname` TEXT NOT NULL ,
`dateofbirth` DATE NOT NULL ,
`id` LONGTEXT NOT NULL ,
`contact` LONGTEXT NOT NULL ,
`datejoined` DATE NOT NULL ,
`membertype` ENUM NOT NULL ,
PRIMARY KEY ( `memberid` )
) ENGINE = MYISAM

MySQL said: Documentation

#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 'NOT NULL, PRIMARY KEY (memberid)) ENGINE = MyISAM' at line 1

Dark Knight
  • 6,116
  • 1
  • 15
  • 37

1 Answers1

0

The query should look like this:

CREATE TABLE `simzsy`.`membership` (

`memberid` INT NOT NULL ,
`name` TEXT NOT NULL ,
`surname` TEXT NOT NULL ,
`dateofbirth` DATE NOT NULL ,
`id` LONGTEXT NOT NULL ,
`contact` LONGTEXT NOT NULL ,
`datejoined` DATE NOT NULL ,
`membertype` ENUM('normal','admin','some_other_kind') default 'normal',
PRIMARY KEY ( `memberid` )
) ENGINE = MYISAM

So you enumerate all the possible values and set default value that is set if nothing is selected (instead of not null)

Ruli
  • 2,592
  • 12
  • 30
  • 40