In fact it seems to be just to opposite.  I toggled the default values to
be null and allowed for the null option and "poof"  it worked!  I don't
really understand this very well.  Wish I did.

>
> Some key in the table is null when it shouldnt be, or the type of the join
> keys isnt the same. i have had issues when importing data from a dump so
> i've had to do a FORIEGN_KEY_CHECKS=0
> >
> > So I have made a table called 'uid' where on uid is the only field in
> > the table.  Then I make another table called 'users' where there are
> > two  fields, 'uid1' and 'uid2' and both uid values have foreign key
> > constraints referencing the 'uid' field in the uid table.
> >
> > No problem, tables are created and are all empty.
> >
> > Then I try inserting a uid varchar value of 'test' into the uid
> > table...
> >
> > ok works,
> >
> > Then I try inserting a uid1 and uid2 varchar value of 'test' into the
> > users table...
> >
> > I get a foreign key constraint error or 1216:
> >
> >  #<MysqlError: Cannot add or update a child row: a foreign key
> > constraint fails>
> > 1216
> >
> >
> > Does anyone know what I am doing wrong?
> >
> > Thanks,
> > -Cere
> >
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:
> > http://lists.mysql.com/[EMAIL PROTECTED]
>
>
>
>

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        Cere Davis
                Unix Systems Administrator - CSDE
            [EMAIL PROTECTED]   ph: 206.685.5346
         https://staff.washington.edu/cere

GnuPG Key   http://staff.washington.edu/cere/gpgkey.txt
Key fingerprint = B63C 2361 3B9B 8599 ECC9  D061 3E48 A832 F455 9E7FA




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to