title: MySQL insert statement fails with foreign key constraint
body: <p>I have this statement:</p>
  
  <pre><code>INSERT INTO `alias`( `alias`, `ref_links_id`) VALUES ("3334",4)
  </code></pre>
  
  <p>And I get this error:</p>
  
  <pre><code>Cannot add or update a child row: a foreign key constraint fails 
  
  (`bestr_main`.`alias`, CONSTRAINT `alias_ibfk_1` FOREIGN KEY (`ref_links_id`) 
  
  REFERENCES `links` (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE)
  </code></pre>
  
  <p>The alias table is connected to link table with a foreign key.
  Why do I get this error when inserting a record?</p>
  
  <p>I see now.. I tried to change the link between the keys to another table and I get this:</p>
  
  <pre><code>  1452 - Cannot add or update a child row: a foreign key constraint fails 
  
    (`bestr_main`.&lt;result 2 when explaining filename '#sql-73c_38e0'&gt;, CONSTRAINT 
  
   `#sql-73c_38e0_ibfk_1` FOREIGN KEY (`ref_links_id`) REFERENCES `refs` (`ref_id`) 
  
   ON DELETE CASCADE ON UPDATE C) 
  </code></pre>
  
  <p>What does that say?</p>