PHP Classes

PHP MySQL Info to MD: Generate a MySQL table structure Markdown report

Recommend this page to a friend!

  Author Author  
Picture of Stefan Kientzler
Name: Stefan Kientzler <contact>
Classes: 17 packages by
Country: Germany Germany
Innovation award
Innovation award
Nominee: 10x

Winner: 6x


  Detailed description   Download Download .zip .tar.gz  
This package can generate a MySQL table structure Markdown report.

It takes a MySQLi database connection handler and performs queries to extract the structure of the database tables.

The package can generate reports in Markdown format to display the database table details like the table name, MySQL database engine, number of rows, last updated date, table fields, table keys and create table SQL statement.

Details

Generating report for a given MySQL database as MD-Files

Latest Stable Version License Donate Minimum PHP Version

Overview

This class can generate a complete documentation of a MySQL database in Markdown format. In the MD format the documentation can be made available for everyone who is involved in an project containing a MySQL database. There are various scenarios: - The easies way is just make the files accessible at the filesystem/fileserver - More comfortable can be a webbased publication as part of an intra- or extranet since the MD format is wide supported - Or you can integrate it into other proprietaire layers (i.e. wikis, documentation systems, ...)

The report contains 1. An overview file with links to datail files for - tables - views - procedures - functions - trigger 2. Details for tables and views - all fields with datatype and keydefinition, nullable, defaultvalue - defined triggers - defined constraints

 - tables referenced by this table
 - tables that references this table
  1. Details for precedures, functions and trigger - create statement containing all infos

Usage

  1. Create an `mysqli` connection to the database to build the report for.
  2. Create an instance of the `MySqlInfoMD()` class and pass the DB connection
  3. Set prefered directories and options
  4. Call the `buildInfo()` method.
$strDBHost = 'localhost';
$strDBName = 'demo';
$strDBUser = 'demo';
$strDBPwd = 'demoPWD';
$oDB = mysqli_connect($strDBHost, $strDBUser, $strDBPwd, $strDBName);

$oInfo = new MySqlInfoMD($oDB, $MySqlInfoMD::STANDALONE);
$oInfo->setOptions(MySqlInfoMD::OPT_CREATE_SUBFOLDER | MySqlInfoMD::OPT_CREATE_STMT);
$oInfo->buildInfo();

> Note: > Since the Markdown renderer that is used at phpClasses.org do not support MD > tables, you will not get a satisfactory display if you look at the example directly > in the source view window here in the package.

Supported types

The report can be generated for - STANDALONE Create the MD files for standalone use (file or web based) to view with a browser addon or any MD viewer - GITHUB_WIKI Build the MD files to upload to a Github-Wiki. - SKIEN_WIKI Build the MD files for display inside a self defined structure for more complex wikis.

recommended browser add-ons

A very good display quality you get e.g. with the browser add-on *'Markdown Viewer'* (from somiv) that is available for most major browsers:

firefox

https://addons.mozilla.org/de/firefox/addon/markdown-viewer-chrome/

chrome

https://chrome.google.com/webstore/detail/markdown-viewer/ckkdlimhmcjmikdlpkmbgfkaikojcbjk?hl=de

or visit on github

https://github.com/simov/markdown-viewer


  Classes of Stefan Kientzler  >  PHP MySQL Info to MD  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog (1)  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: PHP MySQL Info to MD
Base name: mysqlinfomd
Description: Generate a MySQL table structure Markdown report
Version: 1.0.0
PHP version: 7.4
License: GNU General Public License (GPL)
 
  Groups   Applications   Files Files  

  Groups  
Group folder image Databases Database management, accessing and searching View top rated classes
Group folder image Utilities and Tools General purpose tools to simplify software development View top rated classes
Group folder image PHP 7 Classes using PHP 7 specific features View top rated classes


  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Files folder imageExample (1 file, 2 directories)
Files folder imageSKien (1 directory)
Accessible without login Plain text file autoloader.php Aux. Auxiliary script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file MySqlInfoExample.php Example Example script
Accessible without login Plain text file phpstan.neon Data Auxiliary data
Accessible without login Plain text file readme.md Doc. Documentation

  Files folder image Files  /  Example  
File Role Description
Files folder imageimages (5 files)
Files folder imageTables (3 files)
  Accessible without login Plain text file index.md Data Auxiliary data

  Files folder image Files  /  Example  /  images  
File Role Description
  Accessible without login Image file checked.png Icon Icon image
  Accessible without login Image file mul_key.png Icon Icon image
  Accessible without login Image file pri_key.png Icon Icon image
  Accessible without login Image file unchecked.png Icon Icon image
  Accessible without login Image file uni_key.png Icon Icon image

  Files folder image Files  /  Example  /  Tables  
File Role Description
  Accessible without login Plain text file Table_Board.md Data Auxiliary data
  Accessible without login Plain text file Table_Employee.md Data Auxiliary data
  Accessible without login Plain text file Table_Section.md Data Auxiliary data

  Files folder image Files  /  SKien  
File Role Description
Files folder imageMySqlTools (1 file)

  Files folder image Files  /  SKien  /  MySqlTools  
File Role Description
  Plain text file MySqlInfoMD.php Class Class source

Download Download all files: mysqlinfomd.tar.gz mysqlinfomd.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
  Files folder image Files  
File Role Description
Files folder imageExample (1 file, 2 directories)
Files folder imageSKien (1 directory)
Accessible without login Plain text file autoloader.php Aux. Auxiliary script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file MySqlInfoExample.php Example Example script
Accessible without login Plain text file phpstan.neon Data Auxiliary data
Accessible without login Plain text file readme.md Doc. Documentation

  Files folder image Files  /  Example  
File Role Description
Files folder imageimages (5 files)
Files folder imageTables (3 files)
  Accessible without login Plain text file index.md Data Auxiliary data

  Files folder image Files  /  Example  /  images  
File Role Description
  Accessible without login Image file checked.png Icon Icon image
  Accessible without login Image file mul_key.png Icon Icon image
  Accessible without login Image file pri_key.png Icon Icon image
  Accessible without login Image file unchecked.png Icon Icon image
  Accessible without login Image file uni_key.png Icon Icon image

  Files folder image Files  /  Example  /  Tables  
File Role Description
  Accessible without login Plain text file Table_Board.md Data Auxiliary data
  Accessible without login Plain text file Table_Employee.md Data Auxiliary data
  Accessible without login Plain text file Table_Section.md Data Auxiliary data

  Files folder image Files  /  SKien  
File Role Description
Files folder imageMySqlTools (1 file)

  Files folder image Files  /  SKien  /  MySqlTools  
File Role Description
  Plain text file MySqlInfoMD.php Class Class source

Download Download all files: mysqlinfomd.tar.gz mysqlinfomd.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.