Php generates mysql Data Dictionary and phpmysql dictionary

Source: Internet
Author: User

Php generates mysql Data Dictionary and phpmysql dictionary

It is necessary to generate a data dictionary from the mysql database to facilitate viewing database tables and fields. You only need to modify the configuration below to use it, the style is also quite good.

<? Php header ('content-type: text/html; charset = UTF-8 '); define ('db _ host', 'localhost'); define ('db _ user ', 'root'); define ('db _ pass', 'root'); define ('db _ name', 'test'); define ('db _ port ', 3306); define ('db _ CHAR ', 'utf8'); define ('appname', ''); $ conn = mysql_connect (DB_HOST. ':'. DB_PORT, DB_USER, DB_PASS); mysql_select_db (DB_NAME); mysql_query ('set names '. DB_CHAR); $ SQL = "SHOW TABLE STATUS FROM ". DB_NAME; $ resu Lt = mysql_query ($ SQL); $ array = array (); while ($ rows = mysql_fetch_assoc ($ result) {$ array [] = $ rows ;} // table count $ tab_count = count ($ array); echo '<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.