Page 1 of 1

Internal Server Error [500] with foreign key constraint

Posted: Wed Jul 09, 2014 10:30 pm
by petern
Hi,

First of all, compliments on what looks like an amazing and promising product. From what I have seen so far, it fills in an important gap for people (like me) to make the switch from MS Access to MySQL. Thank you also for releasing it under the GPL.

The problem I'm having right now is that even in the simplest setup of only one parent table (tableone) with a foreign key constraint to one child table (tabletwo), I get an Internal Server Error [500] when trying to save a new record in the parent. I'm sure the value I entered for the foreign key exists in the child. Adding similar records in the parent table using other applications is no problem. Only by removing the foreign key constraint, can I add a record using nuBuilderPro. See the attachment for more details.

I'm using MAMP 3.0.4 with Apache 2.2.26, MySQL 5.5.34 and PHP 5.4.26. See the attachments for more details.

This is what I tried already:
  • Different PHP versions (5.4.26 and 5.5.10).
  • Different nuBuilderPro versions (one downloaded from the website on June 4, 2014 and one downloaded from github today, July 9, 2014.
  • Reproduced under two different schemas.
  • Created forms manually and by the form wizard.
  • Set parameters in php.ini according to these requirements.
Attached are more details. Just let me know if more information is needed.

Thank you,
Peter

Re: Internal Server Error [500] with foreign key constraint

Posted: Thu Jul 10, 2014 3:52 am
by admin
petern,

You may have to remove the foreign key constraints

Steven

Re: Internal Server Error [500] with foreign key constraint

Posted: Thu Jul 10, 2014 8:13 am
by petern
You mean this is by design?

Re: Internal Server Error [500] with foreign key constraint

Posted: Fri Jul 11, 2014 7:20 am
by petern
Hi Steven,

As said in my original post, I did try to remove the foreign key constraint and then it works. However, I would really like to keep the constraint on.

Best regards,
Peter

Re: Internal Server Error [500] with foreign key constraint

Posted: Thu Jul 17, 2014 12:39 am
by admin
Peter,

At this time, foreign key constraints will not work with nuBuilder Pro, but you don't need foreign key constraints to have a one to many relationship in a database, you just need foreign keys.

Steven

Re: Internal Server Error [500] with foreign key constraint

Posted: Sun Jul 27, 2014 5:12 pm
by petern
Ok, thanks for your explanation, hope support for this can be added soon!

Re: Internal Server Error [500] with foreign key constraint

Posted: Tue Jul 29, 2014 11:52 pm
by admin
.

Re: Internal Server Error [500] with foreign key constraint

Posted: Mon Apr 17, 2017 3:45 pm
by jens
Hi,
admin wrote: At this time, foreign key constraints will not work with nuBuilder Pro, but you don't need foreign key constraints to have a one to many relationship in a database, you just need foreign keys.
I've hit the same problem. That is, designed my MySQL schema with foreign keys for the sake of referential integrity. But then I hit this 500 Server Error too.

As far as I learnt, I could still have some kind of data integrity by using a Dropdown referencing values (external foreign keys from another table). So this way the users would still only be a able to insert existing values. And this way there would also be some kind of referential integrity, but not done on the MySQL DB level, but at the application level by nuBuilderPro. Is this right?

I'm asking because I do not understand what should be the difference between foreign key constraints and foreign keys as given in the above answer. I'm not a MySQL expert, but googling for these terms suggests that foreign keys are always constraints in MySQL, see http://stackoverflow.com/questions/3105 ... difference or http://stackoverflow.com/questions/1265 ... oreign-key. So I am having problems to understand what I should practically do with the suggestion `you just need foreign keys`.

Kind regards,
Jens