PHP Classes

Data Dictionary: Output the structure of a MySQL database

Recommend this page to a friend!
  Info   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 67%Total: 767 This week: 1All time: 4,406 This week: 560Up
Version License PHP version Categories
data-dictionary 1.0.0Free for non-comm...5.0PHP 5, Databases
Description 

Author

This package can output the structure of a MySQL database.

The main class performs queries to retrieve the list of databases in a MySQL server, the information and the list of tables of a database, and the information and list of fields of a table.

It uses the PDO extension access a MySQL server but it can be adapted to support other types of database servers.

The package comes also with separate classes to display the retrieved databases, tables and fields in HTML tables, as well export that information in XML or CSV formats.

Picture of Sylvia Sotomayor
Name: Sylvia Sotomayor <contact>
Classes: 1 package by
Country: United States United States
Age: ???
All time rank: 2715375 in United States United States
Week rank: 416 Up46 in United States United States Up

Details

Functionality to display a data dictionary for any database on the server. This defaults to displaying a webpage (index.php) and can also create csv and xml files. Developed and tested on a MySQL server; however, since it uses the PDO library, this ought to be usable on any type of database server that a) is supported by PDO, and b) uses the information_schema database as per the ANSI standards. This is for development use only. Do not use on a production server or anywhere else publicly accessible. Like phpinfo(), this might give people information that you don't want them to have. Use at your own risk. files provided index.php displays information_schema's data dictionary as a webpage and provides links to all the server's databases' data dictionaries and provides functionality to convert displayed data dictionary to csv or xml consider this as an example schemas.css colors used: blue, gray, #ddddff DataDictionary.class.php Class: DataDictionary __construct($dsn, $host, $dbase, $user, $pass) creates a database connection using the PDO library and uses three sql statements to get database information from the information_schema database public functions: getDBarray() returns the names of all databases on the server as an array getDBtablearray() returns table information for the tables in a database as an array getTablearray() returns the names of all tables in a database as an array getTabledetails() returns column information for all the tables in a database as an array getColarray($table) returns column information for a specific table as an array getColumnHeadings($array) returns the array keys for an array DDConverver.class.php Class: DDConverter extends DataDictionary __construct($type, $dsn, $host, $dbase, $user, $pass) calls DataDictionary and based on $type, returns a csv file or an xml document no public functions DDPresenter.class.php Class: DDPresenter html helper functions for index.php public functions: createDBNavbar($dbarray) creates list of databases as GET links createTablesNavbar($tablearray) creates list of database tables as internal links createTable($array, $headers) creates a table to display information

  Files folder image Files  
File Role Description
Plain text file DataDictionary.class.php Class Data Dictionary main class
Plain text file DDConverter.class.php Class Converts Data Dictionary to csv or xml
Plain text file DDPresenter.class.php Class HTML helper class
Accessible without login Plain text file index.php Example main example page
Accessible without login Plain text file README.txt Doc. documentation
Accessible without login Plain text file schemas.css Data style sheet

 Version Control Unique User Downloads Download Rankings  
 0%
Total:767
This week:1
All time:4,406
This week:560Up
User Ratings User Comments (2)
 All time
Utility:87%StarStarStarStarStar
Consistency:83%StarStarStarStarStar
Documentation:75%StarStarStarStar
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:67%StarStarStarStar
Rank:465