Cannot add foreign key constraint - Error
<p>I have tried searching for a fix for this error, but haven't got anything yet!
I have written the following query:</p>

<pre><code>Create table menuitem (
    itemID int(10) not null auto_increment
  , headerID int(10) not null
  , itemType varchar(45)
  , description varchar(300)
  , price decimal(10,2)
  , primary key(itemID)
  , foreign key(headerID) references menuheader(headerID));
</code></pre>

<blockquote>
  <p>And i get the error - Cannot add foreign key constraint.</p>
</blockquote>

<p>The HeaderID field is the same data type as what is there in the Menuitem table, but i still get the error!</p>

<p>Please help. (It might be something very silly i might have missed)</p>