|
Posted by Rik on 07/05/07 14:19
On Thu, 05 Jul 2007 13:19:18 +0200, Giulio Simeone
<viandante20005@yahoo.it> 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?
This is a database question, not PHP, so ask in a database group.
That being said: in MySQL it's only possible to leave a foreign key
'empty' when using NULL, no other values allowed. So the field has to
allow NULL values, and NULL is not the same as 0 or an empty string.
--
Rik Wasmus
Navigation:
[Reply to this message]
|