Home > Backend Development > PHP Tutorial > PHP script to export MySQL data dictionary (code example)

PHP script to export MySQL data dictionary (code example)

藏色散人
Release: 2023-04-08 11:50:01
forward
3392 people have browsed it

PHP script to export MySQL data dictionary (code example)

Tools

1.PHP environment: preferably PHP7, with the mysqli extension installed

2.nginx/Apache: This script can be accessed on the browser side

Function

1. Export html, you can choose whether to include the left directory

2. Export Word in html format, prompt for download

3.Support export of all tables and partial tables

4.Support regular expressions when exporting partial tables

Usage example

include('./DBdic.php');
//浏览器显示
DBdic::ini('localhost', 'db_name', 'username', 'password')->outForBrowser();
//浏览器显示, 带左侧菜单
DBdic::ini('localhost', 'db_name', 'username', 'password')->outForBrowserWithMenu();
//下载word文档
DBdic::ini('localhost', 'db_name', 'username', 'password')->outForWord();
//只导出一个表
DBdic::ini('localhost', 'db_name', 'username', 'password')->setExportTable('user')->outForBrowser();
//导出部分表, 支持正则
DBdic::ini('localhost', 'db_name', 'username', 'password')->setExportTableArray(['user', 'goods_.*', 'product_\d{4}'])->outForBrowser();
Copy after login

Source code download

Code Cloud Summer-Mysql-Dic(https://gitee.com/myDcool/PHP-DBDIC)

For more php related knowledge, please visit php tutorial!

The above is the detailed content of PHP script to export MySQL data dictionary (code example). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template