DaDaBIK
This forum is devoted to the discussion about the software DaDaBIK database front-end
the PHP Database application generator for MySQL, PostgreSQL and SQLite; also available for Wordpress.

Welcome! Log In Create A New Profile

Advanced

Data entry to multiple tables linked by foreign key?

Posted by arjan 
Data entry to multiple tables linked by foreign key?
April 13, 2016 09:23AM
I'm evaluating Dadabik, and I'm wondering if there's a way to insert data to multiple tables linked by foreign key.

Examples:
- A form to create a new record in a child table, with ability to not only reference but also create a row in the parent table, which is then used in the foreign key column of the record in the child table.
- A form to create a new record in a parent table, with ability to create one or more child records which will reference it.

Can this be done in Dadabik? Are there any examples of it?
Re: Data entry to multiple tables linked by foreign key?
April 13, 2016 12:02PM
Hello Arjan,
about 1) yes, it is possible, you can use a select_single field and set the option "Other choices allowed?" to yes: in this way you can add custom options on-the-flay and the options will also be added as new records to the parent table. To see an example, run the first online demo, choose "movies", edit a movie and change the director select "other..." from the listbox; now specify a custom director and save. You can see that such new director has been inserted in the director tables.

2) I think you are referring to a master-details form here: run demo n.2, select "invoices" and try to edit an invoice to see the related invoice items.

Best,

________________________________________________________
Eugenio |\.-./| DaDaBIK developer and project admin
Re: Data entry to multiple tables linked by foreign key?
April 15, 2016 07:04AM
Thanks, those are indeed examples of what I had i mind!
Sorry, only registered users may post in this forum.

Click here to login