title: MySQL Table with Foreign Key on Xampp
body: <p>I have been looking into many posts here and other places but I still can't make it work.</p>
  
  <p>I'm trying to create the following 2 tables on xampp. But I'm having problems in the second with the foreign key, even after added the InnoDB. </p>
  
  <p>Can anyone take a look at the following code and tell me what am i doing wrong in the foreign key part so that xampp doesn't accept the table? Thank you!</p>
  
  <pre><code>CREATE TABLE fichas (
      id_ficha INT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE,
      cod_produto VARCHAR(20) NULL,
      nome_produto VARCHAR(50),
      versao INT,
      data_ficha DATE,
      PRIMARY KEY (id_ficha)
  ) ENGINE=INNODB;
  
  CREATE TABLE ident_dangers (
      id_fichas INT NOT NULL,
      class_subst TEXT NULL,
      simb_perigo VARCHAR(50) NULL,
      words_r VARCHAR (200) NULL,
      INDEX (id_fichas),
      FOREIGN KEY (id_fichas) REFERENCES fichas(id_ficha),
  ) ENGINE = InnoDB;
  </code></pre>