Many to many structure

N

Noam

Guest
Hi,
I would like to know if Dadabik can help me to solve the following scenario:

I have three table:
movie - the movies table
actor - the actors tables
actorToMovie - connect actors to movies

these structure known as "many to many" structure, cause a specific actor can belong to many movies and a specific movie can belong to many actors.

I want to create an interface for editing movie that display the list of actors that belong to that movie and enable adding/removing actors from that movie.

I would like to know how can I do it with Dadabik.
 
A

alpha2zee

Guest
I think you would need some modification to DaDaBik to achieve this. If you use version 3.2, you can get them here. The first modification allows multiple selection - see http://www.dadabik.org/forum/read.php?f=1&i=5530&t=5530. The second will allow the passing of extra MySQL select clauses. See http://www.dadabik.org/forum/read.php?f=1&i=5492&t=5492. If this is the first time you want to use DaDaBik, you can use this modified version which already has those two modifications (and more) - see http://www.dadabik.org/forum/read.php?f=1&i=5536&t=5536.
 
A

alpha2zee

Guest
On second thought, you can achieve your aim with just the first modification (above) as I don't see a need for the actorToMovie table.

Say your actor table is like this -

name, movies, birthdate, awards

And the movie table like this -

name, actors, producers, directors

Then, for the insert/update form for the actor table, for the field which stores the movies the actor stars in -

make the field 'multiple select' or 'multiple checkbox' type;
allow 'other choices';
for the foreign table, choose 'movie';
use 'name' for the 'primary key' and 'linked field' fields.

And for the insert/update form for the movie table, for the field which stores the actors the movie has -

make the field 'multiple select' or 'multiple checkbox' type;
allow 'other choices';
for the foreign table, choose 'actor';
use 'name' for the 'primary key' and 'linked field' fields.
 
Top