HomePHP Page 6 - Doing More with phpMyAdmin (Part 2)
Looking Up the Dictionary - PHP
In the first segment of this two-part tutorial, I gave you a quick overview of some of the interesting new features available in phpMyAdmin. In this concluding segment, find out how to use phpMyAdmin to define relationships between tables, maintain a log of commonly-used queries and create entity-relationship diagrams.
One of the most interesting features to be introduced in the latest version of phpMyAdmin is the ability to create a database dictionary in PDF format. For the uninformed, this is a comprehensive document that offers an overview of all the objects in a database - tables, columns, primary keys - together with a neat little relationship diagram that outlines the foreign key references between the tables.
In order to accomplish this Herculean task, phpMyAdmin leverages off the information provided when creating the foreign key relationships (discussed earlier). Table and column comments entered by the table designers are also included in the dictionary, thus making it a good reference document for all developers working with the database.
The best way to understand what a database dictionary is, is with an example. Select a database - I'll use the accounts database created earlier - and use the Edit PDF Pages link at the bottom of the page to obtain this screen.
Specify a name for the PDF document, (say, “Accounting Database") and select the Automatic layout option. After clicking Go, the same page will reload and display some supplementary information, as shown here.
You can now select the tables to be included in the dictionary, together with some ancillary settings related to the formatting of the relationship diagram. You can either change the locations of the tables in the final diagram using X and Y coordinates, or use the Toggle Scratchboard button to open up a WYSIWYG editor that allows you to place each table exactly where you want it (note that this feature needs Internet Explorer 6.0 or equivalent). Example.