南京网站建设小程序开发 雷仁网络,什么是网络营销推广,重庆网站推广营销,怎么用.net做网站经常为了方便和直观#xff0c;我们会首先直接在数据库中设计出表#xff0c;但是接下来又要将表的结构和设计编写在设计文档中#xff0c;以便编码的时候可以直观的查询#xff0c;一旦数据库表非常多#xff0c;字段非常多的时候#xff0c;这无疑是件非常郁闷的工作。… 经常为了方便和直观我们会首先直接在数据库中设计出表但是接下来又要将表的结构和设计编写在设计文档中以便编码的时候可以直观的查询一旦数据库表非常多字段非常多的时候这无疑是件非常郁闷的工作。 这是一个漂亮的PHP页面可以自动输出MySql数据库所有表结构大大方便了文档的编写工作也同时非常方便编码的时候进行查询。当然在设计MySql数据库表和字段的时候详细填写表和字段的备注这是非常好的习惯对这个网页的输出也是最佳效果的。 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdhtml xmlnshttp://www.w3.org/1999/xhtmlheadmeta http-equivContent-Type contenttext/html; charsetutf-8 /style typetext/css!--body,table{ font-size:13px;}table{ table-layout:fixed; empty-cells:show; border-collapse: collapse; margin:0 auto; border:1px solid #cad9ea;}th{ height:22px; font-size:13px; font-weight:bold; text-align:center;}td{ height:20px;}.tableTitle{font-size:14px; font-weight:bold;}/styletitlezuizen数据库结构/title/headbodydiv stylemargin:0 auto;width:880px; border:1px #006600 solid; font-size:12px; line-height:20px; div stylewidth:100%;height:30px; font-size:16px; font-weight:bold; text-align:center; **网数据库结构br / font stylefont-size:14px; font-weight:normal;?php echo date(Y-m-d h:i:s); ?/font /div ?php $dbconnmysql_connect(localhost, root,123); $sqlnameinformation_schema; mysql_select_db($sqlname,$dbconn); session_start(); $sql SELECT * FROM tables where table_schemadb_zuizen order by TABLE_NAME; $result mysql_query($sql); while($rowmysql_fetch_array($result)) { //print_r($row); ? div stylemargin:0 auto; width:100%; padding-top:10px; b classtableTitle表名 ?php echo $row[TABLE_NAME] ? /b br / ?php echo $row[TABLE_COMMENT] ? /div table width100% border1 thead th width70序号/td th width170字段名/td th width140字段类型/td th width80允许为空/td th width70默认值/td th备注/td /thead ?php $sql2 SELECT * FROM columns where table_name.$row[TABLE_NAME]. order by COLUMN_NAME; $result2 mysql_query($sql2); $num0; while($row2mysql_fetch_array($result2)) { $num $num1; //print_r($row); ? tr td aligncenterb?php echo $num ?/b/td td?php echo $row2[COLUMN_NAME] ?/td td?php echo $row2[COLUMN_TYPE] ?/td td aligncenter?php echo $row2[IS_NULLABLE] ?/td td aligncenter?php echo $row2[COLUMN_DEFAULT] ?/td td?php echo $row2[COLUMN_COMMENT] ?/td /tr ?php } ? /table ?php } mysql_close($dbconn); ?/div/body/html 以下为运行抓取的样子 转自http://blog.51cto.com/babyhe/1118372 转载于:https://www.cnblogs.com/apolloren/p/8401594.html