Giulio Simeone wrote:
> Hello,
> when I try to insert a new record in a certain table I get the error
>
> Cannot add or update a child row: a foreign key constraint fails
>
> The table has three foreign keys and six other fields, but this error
> appairs with every record I try to insert in the table, even if I
> don't give any values to the foreign keys.
>
> What can be the problem?

The problem is the foreignKeys. You do not have the foreignKey
constraint satisfied and that's why MySql is complaining. ForeignKeys
means that for that value, you have the entry in the foreign Table.

If you have table "Posts" in which you define category_id as the
foreign key then, the value of category_id must be present in id field
of category table.

Cheers,
Ketan ;-)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to