insert/update/delete related tables
Posted: 2011-05-22 19:21
First i would like to say i've read allot of documentation and forum posts all over the internet for the last few days but I have not managed to fully complete this task. I found incomplete info about this or maybe I am incapable to apply that documentation that is why I am asking for help here.
If there is smth you don't understand about my problem please ask! I'm a beginner so mistakes happen quite often for me.
Here is a database example: Let's say I have 2 tables like this:
**Books**
id(int,autoincrement,primary key),
book_name (varchar),
book_details (varchar),
authors_id (int)
**Authors**
authors_id(int,autoincrement,primary key),
author_name(varchar)
I want to link these 2 tables so that for each book I can insert multiple authors
I've created a Dynamic list that displays all the books in the Database using the books table.
My goal: When I click to insert/edit a selected book I want to be redirected to a page where I can insert/edit the first table(books) - master table - plus add a field with the number of authors i want to add in the next step (page), after click on the edit/insert to be redirected to a second page where I can edit/insert multiple records in the second table(authors) - slave table. On this second page i should have a number of fields for inserting authors of that book according to the number specified in the first page.
Also when I click on the delete button in the Dynamic list to delete the info in both tables
General question: How do I edit/insert/delete into 2 related tables (1.master,2.slave) on 2 subsequent pages using Mx Kollection (or ADDT)
Please give as much details as possible, in steps if you can (eg. 1: do this, 2: do this).
--------------------------------------------------------------------------------------------------------
My solution: creating 2 pages with 1 dynamic form in each but how do I connect those 2 tables and forms so that the tables are related and the data inserted/updated/deleted correctly?Sending some data through url? maybe, but how exactly i'm too stupid to figure this out.
If there is smth you don't understand about my problem please ask! I'm a beginner so mistakes happen quite often for me.
Here is a database example: Let's say I have 2 tables like this:
**Books**
id(int,autoincrement,primary key),
book_name (varchar),
book_details (varchar),
authors_id (int)
**Authors**
authors_id(int,autoincrement,primary key),
author_name(varchar)
I want to link these 2 tables so that for each book I can insert multiple authors
I've created a Dynamic list that displays all the books in the Database using the books table.
My goal: When I click to insert/edit a selected book I want to be redirected to a page where I can insert/edit the first table(books) - master table - plus add a field with the number of authors i want to add in the next step (page), after click on the edit/insert to be redirected to a second page where I can edit/insert multiple records in the second table(authors) - slave table. On this second page i should have a number of fields for inserting authors of that book according to the number specified in the first page.
Also when I click on the delete button in the Dynamic list to delete the info in both tables
General question: How do I edit/insert/delete into 2 related tables (1.master,2.slave) on 2 subsequent pages using Mx Kollection (or ADDT)
Please give as much details as possible, in steps if you can (eg. 1: do this, 2: do this).
--------------------------------------------------------------------------------------------------------
My solution: creating 2 pages with 1 dynamic form in each but how do I connect those 2 tables and forms so that the tables are related and the data inserted/updated/deleted correctly?Sending some data through url? maybe, but how exactly i'm too stupid to figure this out.