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

Subscribe to our news:
Partners
Testimonials
Mike Little: "Great product, thank you for your great work and sharing".
Anley Lafleur: "I cannot wait to start using your exciting product and I am sure it will help me achieve my objectives".

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 view and edit records from master and detail data sources (like country/city) on a single page. So, browsing the page representing product information, you can, for example, see all the orders related to a certain product, add new orders, edit/delete existing orders, and so on; 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 a single click and at the same time it is possible to see addresses of customers living in a certain city.

 

 

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.

 

Creating master-detail views

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