title: mysql Foreign key constraint is incorrectly formed error
body: <p>I have two tables, <code>table1</code> is the parent table with a column <code>ID</code> and <code>table2</code> with a column <code>IDFromTable1</code> (not the actual name) when I put a FK on <code>IDFromTable1</code> to <code>ID</code> in <code>table1</code> I get the error <code>Foreign key constraint is incorrectly formed error</code>. I would like to delete table 2 record if <code>table1</code> record gets deleted. Thanks for any help</p>
  
  <pre><code>ALTER TABLE `table2`  
     ADD CONSTRAINT `FK1` 
        FOREIGN KEY (`IDFromTable1`) REFERENCES `table1` (`ID`) 
        ON UPDATE CASCADE 
        ON DELETE CASCADE;
  </code></pre>
  
  <p>Let me know if any other information is needed. I am new to mysql</p>