title: ERROR 1452: Cannot add or update a child row: a foreign key constraint fails
body: <p>I have created tables in MySQL Workbench as shown below :</p>
  
  <p><strong>ORDRE table:</strong></p>
  
  <pre><code>CREATE TABLE Ordre (
    OrdreID   INT NOT NULL,
    OrdreDato DATE DEFAULT NULL,
    KundeID   INT  DEFAULT NULL,
    CONSTRAINT Ordre_pk PRIMARY KEY (OrdreID),
    CONSTRAINT Ordre_fk FOREIGN KEY (KundeID) REFERENCES Kunde (KundeID)
  )
    ENGINE = InnoDB;
  </code></pre>
  
  <p><strong>PRODUKT table:</strong></p>
  
  <pre><code>CREATE TABLE Produkt (
    ProduktID          INT NOT NULL,
    ProduktBeskrivelse VARCHAR(100) DEFAULT NULL,
    ProduktFarge       VARCHAR(20)  DEFAULT NULL,
    Enhetpris          INT          DEFAULT NULL,
    CONSTRAINT Produkt_pk PRIMARY KEY (ProduktID)
  )
    ENGINE = InnoDB;
  </code></pre>
  
  <p>and <strong>ORDRELINJE table:</strong></p>
  
  <pre><code>CREATE TABLE Ordrelinje (
    Ordre         INT NOT NULL,
    Produkt       INT NOT NULL,
    AntallBestilt INT DEFAULT NULL,
    CONSTRAINT Ordrelinje_pk PRIMARY KEY (Ordre, Produkt),
    CONSTRAINT Ordrelinje_fk FOREIGN KEY (Ordre) REFERENCES Ordre (OrdreID),
    CONSTRAINT Ordrelinje_fk1 FOREIGN KEY (Produkt) REFERENCES Produkt (ProduktID)
  )
    ENGINE = InnoDB;
  </code></pre>
  
  <p>so when I try to insert values into <code>ORDRELINJE</code> table i get:</p>
  
  <blockquote>
    <p>Error Code: 1452. Cannot add or update a child row: a foreign key constraint fails (<code>srdjank</code>.<code>Ordrelinje</code>, CONSTRAINT <code>Ordrelinje_fk</code> FOREIGN KEY (<code>Ordre</code>) REFERENCES <code>Ordre</code> (<code>OrdreID</code>)) </p>
  </blockquote>
  
  <p>I've seen the other posts on this topic, but no luck. 
  Am I overseeing something or any idea what to do? </p>