This topic is locked

Multiple Master Tables

12/7/2007 11:59:03 PM
PHPRunner General questions
G
gaty author

Hi,
I have 2 tables, purchases and details. I have created a master -detail relationship between them and it works fine.

I have also made 2 views which are based on position of purchases, recieved and due.

Now I want Master-detail relationship between the views and the details table.
i.e. I want to open up details of purchaces from the 2 views.
I also want to delete all entries in the details table, when the corresponding entry in the purchases table has been deleted.
Please suggest something. I am stuck.
Thnx

Baty

G
gaty author 12/10/2007

Hi,

I have been able to make the delete stuff works.
Opening up details page from the views is still troubling me. PLEASE HELP!! SOMEBODY!!

Alexey admin 12/10/2007

Hi,
create two custom views based on details table.

Choose recieved as a master for the first view and due - for second.
To delete records from details table use After record deleted event. Here is the sample code:

$sql = "delete from details where purchase_id=".$deleted_values["id"];



where id and purchase_idare your actual field names.

G
gaty author 12/10/2007

Hi Alexy,
Thank you for your reply. But that would mean 3 'details' tables in the menu. Is there any way it can be done with one such table in the menu / display?

J
Jane 12/11/2007

Hi,
to remove some items from menu uncheck it on the Datasource tables tab --> Create menu item for this table option.

G
gaty author 12/12/2007

To Jane & Alexey,
Thank you, Thank you,Thank you.
-

Baty