Choose your database:
MS SQL Server
SQL Anywhere

Subscribe to our news:
Patrick Biegel: "Thanks a lot for your fast reply and the great solution! It works now and that's really important! The PHP Generator for MySQL is a great software".
Grey: "We're a two-person company, it's just me an my wife. I'm the technical guru, and she handles the business operations. I have to know a lot about MySQL, but that's much too technical for her. I have frequently had to setup CGI scripts (I code in Perl) so she can manage some of our tables (suppliers, manufacturers, etc).

I discovered PHP Generator a couple of days ago, tried the free version,and within a few hours I had purchased the Pro version (as well as SQL Maestro for MySQL).

Today I am completing the conversion of the last of my custom table managers to PHP Generator. This is eliminating several thousand lines of code that I don't have to support any more!

Thanks for this fantastic product".


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 continents - to inspect countries of the specific continent 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 continents is represented. For any continent all the corresponding countries may be browsed with a single click and at the same time it is possible to see cities of a certain country.



First 20 detail records can be previewed without opening a separate page. To see all the detail records, click the Full view link above the detail data grid. Alternatively you can access a detail page using the drop-down list on the right of the plus button.



Database schema requirements

To create a two-level master-detail presentation, you need 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:


Automatic creation

If tables are linked with a foreign key and the Setup details by foreign key option is enabled, the first-level detail pages are created automatically.



Manual creation

If tables are NOT linked with a foreign key or the Setup details by foreign key option is disabled, you can create detail pages manually as described below. The same technique is applied for creating nested detail pages.


1. At the Page Management step of the wizard select a root-level page you want to create a detail page for or (for creating a nested detail page) select a detail page in the corresponding list.


2. Click the Add... button on the right of the detail page list to open Link Editor.



3. Select a detail data source (table, view, or query) and columns from the Master field and Detail field lists. Click Add to add a link condition (you can specify multiple columns from each list for a single link). Click Remove to delete a field pair.



4. Click OK to save changes and close Link Editor.



Prev Return to chapter overview Next