Database Report Generator Tool
A simple tool for generating HTML or CSV reports on MySQL databases.
Requirements
PHP 7
PDO PHP Extension
Setup
- Install and enable the PDO extension (installation instructions).
- Create a copy of
config/config_template.php
namedconfig/config.php
and fill out the relevant connection information.
- SQL_SERVER - Server where the MySQL database is located
- SQL_PORT - MySQL port number (will use default if left blank e.g. 3306)
- SQL_DATABASE - Name of the database to generate reports for
- SQL_USER - User with SELECT permissions for SQL_DATABASE
- SQL_PASSWORD - Password for SQL_USER
Usage
Single Table
- Select the table you want to generate a report for.
- Select the columns you want to include in the report.
- Click 'Generate Report' to open the report in a new tab or click 'Download Report as CSV' to export the report as a CSV. Both options open up a new tab, so you can generate multiple reports with different tables and columns without reloading the page.
Joining Tables
-
Select the 'Join Tables' option and click 'Select Tables to Join'. Select the tables you want to join and click 'Next'.
-
Drag the tables in the order you want them to get joined in and click 'Next'.
-
Select the type of join and the columns to join on for each table getting joined and click 'Submit'.
-
Select the columns from each table you would like to display.
-
Click 'Generate Report' to open the report in a new tab or click 'Download Report as CSV' to export the report as a CSV. Both options open up a new tab, so you can generate multiple reports with different tables and columns without reloading the page.