title: MySQL error 150, cannot create table
body: <p>I'm having trouble creating a table and I don't understand what's wrong. phpMyAdmin sets the error indicator next to the PRIMARY KEY declaration... I don't get why this is wrong...</p>
  
  <p>This table is a child table, which has a one-to-many identifying relationship with another table.</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `ruilen`.`Voorwerpen` (
  `voorwerpen_id` INT NOT NULL AUTO_INCREMENT ,
  `naam` VARCHAR( 45 ) NOT NULL ,
  `beschrijving` VARCHAR( 45 ) NULL ,
  `Gebruikers_gebruiker_id` INT NOT NULL ,
  PRIMARY KEY ( `voorwerpen_id` , `Gebruikers_gebruiker_id` ) ,
  CONSTRAINT `fk_Voorwerpen_Gebruikers1` FOREIGN KEY ( `Gebruikers_gebruiker_id` ) REFERENCES `ruilen`.`Gebruikers` (
  `gebruiker_id`
  ) ON DELETE SET NULL ON UPDATE CASCADE
  ) ENGINE = InnoDB;
  
  MySQL said: Documentation
  #1005 - Can't create table 'ruilen.voorwerpen' (errno: 150) 
  </code></pre>
  
  <p>EDIT: this is all the documentation on the error code I can find: <a href="http://dev.mysql.com/doc/refman/5.1/en/error-messages-server.html#error_er_cant_create_table" rel="nofollow noreferrer">Link</a></p>
  
  <p>EDIT2: <em>pic removed</em></p>
  
  <p>EDIT3: </p>
  
  <pre><code>CREATE TABLE `gebruikers` (
   `gebruiker_id` int(11) NOT NULL,
   `naam` varchar(45) NOT NULL,
   `straat` varchar(45) NOT NULL,
   `gemeente` varchar(45) NOT NULL,
   `mail` varchar(45) NOT NULL,
   `beschrijving` varchar(45) DEFAULT NULL,
   PRIMARY KEY (`gebruiker_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1
  </code></pre>