Choose your database:
AnySQL
MySQL
MS SQL Server
Oracle
PostgreSQL
SQLite
Firebird
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Tony Broadbent: "Such a great product! I have been struggling to hand craft pages which, with your PHP Generator, I created beautifully within 5 minutes of downloading it".
Mike Little: "Great product, thank you for your great work and sharing".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

Master-Detail Presentations

Master-detail presentations allow you to navigate a webpage based on a specific table, and at the same time for each selected record (master record) see the associated records from other related tables (details). So, browsing the page representing product information, you can see all the orders corresponding to the necessary products; working with list of countries - to inspect cities of specific countries as on the picture below.

 

 

You can also create nested master-detail presentations when you can see the "details of details". On the picture below the webpage with a list of countries is represented, for any country all the corresponding cities may be browsed with one click and at the same time it's possible to see all addresses of customers living in specific cities.

 

 

To add a master-detail relation within PHP Generator for MySQL means to provide each record of the result webpage with an ability to browse all records associated with this record on a separate Details page as well as with an ability to view the 20 first such records on the result page directly. To open the corresponding Details page, follow the full view link.

 

Database schema requirements

To create a two-level master-detail presentation, you need to have two tables with a parent-child relationship. The foreign key constraints are not required but highly recommended to enforce the referential integrity at the database level.

 

Realization

There are two ways to provide the result webpage with a master-detail presentation:

 

The tables are tables linked with a foreign key. In case the Setup details by foreign key option is enabled, the detail relation will be set automatically.

 

 

The foreign key constraint between theses tables haven't been defined.
1. Open the Page Editor for the page based on the master table and go to the Details tab.

 

2. Click the Add... item of the tab's popup menu.

 

 

3. Set the relation properties to the child table: select this table as Detail data source, and specify the columns with similar data as Master field (select from the list of parent table columns) and Detail field (select from the list of child table columns).

 

 

4. After the fields are completed use the Add button and then click OK.

 

To specify the details appearance, use the Edit... item of the corresponding popup menu and set options in a usual way.

 

To create a nested master-detail presentation, use the same technique as described above (the case the foreign key constraint is not defined).

 

 

 



Prev Return to chapter overview Next