Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Pondelok, 30. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  n:m relationship

phpMyEdit Configuration     n:m relationship
Odoslať novú tému   Odpovedať na tému    
 
wilf123     Založený: 19.06.2007   Príspevky: 1  
Príspevok Zaslal: 2007-06-19 23:21
Návrat hore  Odpovedať s citátom     

Question from phpmyedit-beginner, sorry.

For example:
tbl_books:
id, title, id_category -> refering to tbl_category
(eg thriller, novel, non-fiction, )
...

modeling that with phpmyedit works fine:
...
$opts[fdd][id_category][values][table]='tbl_category';
$opts[fdd][id_category][values][column]='id';
$opts[fdd][id_category][values][description]='category';
...

Now when adding a new record I get a drop down box
for selecting the appropriate value.

Now going one step further:
tbl_authors:
id_book, id_person

In other words: n:m relationship

Can this be modeled with phpmyedit?
I have tried with clickable column "authors"
(with the id of the current book as parameter)
and filters within the tbl_authors generated
form. That works quite well for viewing the
corresponding authors of one specific book.
However it does not let me add an author for
the current book. (I haven't seen a method
of providing the book id to the action associated
with the add button)

Any suggestions?
Is there a working sample covering this?
(I believe the help desk demo does not)
Thanks in advance.

 
michal     Založený: 17.06.2003   Príspevky: 537   Bydlisko: Slovakia
Príspevok Zaslal: 2007-06-20 10:37
Návrat hore  Odpovedať s citátom     

i have a working sample, thou pretty complicated:
- with 'php' option generate html code to represent your data (fetching from db and display)
- in before/after trigger commit the change.

however i cannot see this as a built in feature.

other possiblity is to store data in one column (like 'ACD') and then display with checkboxes (like add, change, delete). this was added at commit 1.183 (see cvs docs)

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov