Internal Server Error [500] with foreign key constraint

Internal Server Error [500] with foreign key constraint

Postby petern » Thu Jul 10, 2014 6:00 am

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
Attachments
petern 20140709 nuBuilderPro forum details.zip
A simple database that will lead to the error in my setup, the phpinfo() output, the nuBuilder installer output and a screenshot of the error.
(287.51 KiB) Downloaded 280 times
petern
 
Posts: 4
Joined: Thu Jul 10, 2014 2:11 am

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

Postby admin » Thu Jul 10, 2014 11:22 am

petern,

You may have to remove the foreign key constraints

Steven
admin
Site Admin
 
Posts: 3078
Joined: Mon Jun 15, 2009 9:53 am

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

Postby petern » Thu Jul 10, 2014 3:43 pm

You mean this is by design?
petern
 
Posts: 4
Joined: Thu Jul 10, 2014 2:11 am

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

Postby petern » Fri Jul 11, 2014 2:50 pm

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
petern
 
Posts: 4
Joined: Thu Jul 10, 2014 2:11 am

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

Postby admin » Thu Jul 17, 2014 8:09 am

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
admin
Site Admin
 
Posts: 3078
Joined: Mon Jun 15, 2009 9:53 am

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

Postby petern » Mon Jul 28, 2014 12:42 am

Ok, thanks for your explanation, hope support for this can be added soon!
petern
 
Posts: 4
Joined: Thu Jul 10, 2014 2:11 am

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

Postby admin » Wed Jul 30, 2014 7:22 am

.
admin
Site Admin
 
Posts: 3078
Joined: Mon Jun 15, 2009 9:53 am

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

Postby jens » Mon Apr 17, 2017 11:15 pm

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
jens
 
Posts: 7
Joined: Fri Apr 14, 2017 7:04 pm


Return to Installation



cron