Code: Select all
CREATE TABLE nelisnw.setjes (
  id int(11) NOT NULL,
  jaar varchar(4) NOT NULL,
  week varchar(2) NOT NULL,
  expediteur_logistiek varchar(8) NOT NULL,
  splitscode smallint(6) NOT NULL,
  zuurcontrole varchar(8) NOT NULL,
  preparatie varchar(2) NOT NULL,
  notitie varchar(20) NOT NULL,
  verkooporderID int(11) DEFAULT NULL,
  setnr int(11) DEFAULT NULL,
  PRIMARY KEY (id))
When I want to save the record, field ID wants to have an value, because it's required. But field ID is primary key and the database has to create an unique number. If I set field ID to required = false, the database stores the field ID as 0.
How can I use this option feature and let the database create an unique number?