Dovresti postare la query CREATE TABLE usata e inoltre dovresti usare il motore InnoDB. Le MyIsam non hanno le foreign keys