title: MySQL error 1452
body: <p>Here's the script </p>
  
  <pre><code>    ALTER TABLE `candycorn`.`bb_users` 
      ADD CONSTRAINT `pf_minecraftusername`
      FOREIGN KEY (`pf_minecraftusername`)
      REFERENCES `candycorn`.`bb_profile_fields_data` (`pf_minecraftusername`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION;
  </code></pre>
  
  <p>and the error description </p>
  
  <pre><code>    ERROR 1452: Cannot add or update a child row: a foreign key constraint fails  
      (`candycorn`.&lt;result 2 when explaining filename '#sql-4e4_1785d'&gt;, CONSTRAINT
      `pf_minecraftusername` FOREIGN KEY (`pf_minecraftusername`) REFERENCES 
      `bb_profile_fields_data` (`pf_minecraftusern)
  </code></pre>
  
  <p>if somebody could, would you explain what I'm missing out here?</p>