Page 1 of 1

Internal Server Error [500] with foreign key constraint

PostPosted: Thu Jul 10, 2014 6:00 am
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

PostPosted: Thu Jul 10, 2014 11:22 am
by admin
petern,

You may have to remove the foreign key constraints

Steven

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

PostPosted: Thu Jul 10, 2014 3:43 pm
by petern
You mean this is by design?

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

PostPosted: Fri Jul 11, 2014 2:50 pm
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

PostPosted: Thu Jul 17, 2014 8:09 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

PostPosted: Mon Jul 28, 2014 12:42 am
by petern
Ok, thanks for your explanation, hope support for this can be added soon!

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

PostPosted: Wed Jul 30, 2014 7:22 am
by admin
.

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

PostPosted: Mon Apr 17, 2017 11:15 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