[2020数据字典php-直接复制]

<?php
/**
* 生成mysql数据字典
*/
header ( "Content-type: text/html; charset=utf-8" );
// 配置数据库
$dbserver = !empty($_POST['dbserver'])?$_POST['dbserver']:"xxxxxx";
$dbusername = !empty($_POST['dbusername'])?$_POST['dbusername']:"root";
$dbpassword = !empty($_POST['dbpassword'])?$_POST['dbpassword']:"root";
$database = !empty($_POST['databases'])?$_POST['databases']:"root";
if (empty($database)) {
?>
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="/favicon.ico" />
<title>MySQL数据字典生成</title>
<style type="text/css">
body {
background:-moz-linear-gradient(top,#,#1c456e); /*火狐*/
background:-ms-linear-gradient(top, #, #1c456e); /*IE10以下没效果*/
background:-webkit-gradient(linear, % %, % %,from(#), to(#1c456e)); /*谷歌,360*/
height:720px;
}
h1 {
font-size:50pt;
color:#ffffff;
font-family:楷体,Arial,Courier;
position:relative;
text-align:center;
left:16px;
top:50px;
} #submits table{
color:#ffffff;
position:relative;
left:600px;
top:70px;
line-height:50px;
}
#image input {
width:80px;
height:40px;
font-size:25px;
border-radius:5px;
font-family:楷体;
}
#image input:hover {
background:#ffffff;
color:#dcb106;
}
th {
font-family:楷体,Arial,Courier;
font-size:20pt;
width:200px;
} td {
text-indent:10px;
}
</style>
</head>
<body>
<div>
<form id='submits' action="/test/Mysql_Dictionary.php" method="post" >
<h1>MySQL数据字典生成</h1>
<table>
<tr>
<th>服务器:</th>
<td>
<input type="text" name='dbserver' id='dbserver' value=''>
</td>
</tr>
<tr>
<th>用户名:</th>
<td>
<input type="text" name='dbusername' id='dbusername' value=''>
</td>
</tr>
<tr>
<th>密码:</th>
<td>
<input type="password" name='dbpassword' id='dbpassword' value=''>
</td>
</tr>
<tr>
<th>数据库名:</th>
<td>
<input type="text" name='databases' id='databases' value=''>
</td>
</tr>
<tr>
<th colspan="" align="center" id="image">
<input type="button" style="width:70px;height:40px;border-radius:5px;" value='生成' onclick="submit_show()">
</th>
</tr>
</table>
</form>
</div>
</body>
</html>
<script type="text/javascript" src="http://www.xcn.ren/Public/js/jquery.min.js"></script>
<script type="text/javascript"> function submit_show(){
databases = $('#databases').val();
if (databases=="") {
alert("请填写数据库名!");
return false;
}
$('#submits').submit();
} </script>
<?php
exit;
} $mysql_conn = @mysqli_connect ( "$dbserver", "$dbusername", "$dbpassword" ) or die ( "Mysql connect is error." );
mysqli_select_db ( $mysql_conn, $database );
mysqli_query ( $mysql_conn, 'SET NAMES utf8');
$table_result = mysqli_query ( $mysql_conn ,'show tables' );
// 取得所有的表名
while ( $row = mysqli_fetch_array ( $table_result ) ) {
$tables [] ['TABLE_NAME'] = $row [];
} // 循环取得所有表的备注及表中列消息
foreach ( $tables as $k => $v ) {
$sql = 'SELECT * FROM ';
$sql .= 'INFORMATION_SCHEMA.TABLES ';
$sql .= 'WHERE ';
$sql .= "table_name = '{$v['TABLE_NAME']}' AND table_schema = '{$database}'";
$table_result = mysqli_query ( $mysql_conn, $sql );
while ( $t = mysqli_fetch_array ( $table_result ) ) {
$tables [$k] ['TABLE_COMMENT'] = $t ['TABLE_COMMENT'];
} $sql = 'SELECT * FROM ';
$sql .= 'INFORMATION_SCHEMA.COLUMNS ';
$sql .= 'WHERE ';
$sql .= "table_name = '{$v['TABLE_NAME']}' AND table_schema = '{$database}'"; $fields = array ();
$field_result = mysqli_query ( $mysql_conn, $sql );
while ( $t = mysqli_fetch_array ( $field_result ) ) {
$fields [] = $t;
}
$tables [$k] ['COLUMN'] = $fields;
}
mysqli_close ( $mysql_conn ); $html = '';
$header_index = '<div id="floatTips"><ul>';
// 循环所有表
foreach ( $tables as $k => $v ) {
// $html .= '<p><h2>'. $v['TABLE_COMMENT'] . '&nbsp;</h2>';
$header_index .= '<li><a href="#' . $v ['TABLE_NAME'] . '" title="购买意向表">' . $v ['TABLE_NAME'] . '</a>(' . $v ['TABLE_COMMENT'].' )</li>';
$html .= '<div style="page-break-before: always;">';
$html .= '<h2><a name="' . $v ['TABLE_NAME'] . '"></a>' . $v ['TABLE_NAME'] . ' &nbsp;&nbsp;&nbsp; ' . $v ['TABLE_COMMENT'] . '</h2>';
$html .= '<table class="print" width="100%"><tbody><tr><th width="50">字段名</th><th width="80">数据类型</th><th width="70">默认值</th> <th width="60">允许非空</th><th width="50">自动递增</th><th>备注</th></tr>';
$html .= ''; foreach ( $v ['COLUMN'] as $f ) {
$html .= '<tr class="even"><td nowrap="nowrap">' . $f ['COLUMN_NAME'] . '</td>';
$html .= '<td xml:lang="en" dir="ltr" nowrap="nowrap">' . $f ['COLUMN_TYPE'] . '</td>';
$html .= '<td>&nbsp;' . $f ['COLUMN_DEFAULT'] . '</td>';
$html .= '<td nowrap="nowrap">&nbsp;' . $f ['IS_NULLABLE'] . '</td>';
$html .= '<td>' . ($f ['EXTRA'] == 'auto_increment' ? '是' : '&nbsp;') . '</td>';
$html .= '<td>&nbsp;' . $f ['COLUMN_COMMENT'] . '</td>';
$html .= '</tr>';
}
$html .= '</tbody></table></p>';
}
$header_index .='</ul><span><a href="#top">返回顶部↑</a></span></div>'; // 输出
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xml:lang="zh" xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<title>'.$database.'</title>
<link rel="shortcut icon" href="./favicon.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
//<![CDATA[
var tips; var theTop = ; var old = theTop;
function initFloatTips() {
tips = document.getElementById("floatTips");
moveTips();
};
function moveTips() {
var tt=;
if (window.innerHeight) {
pos = window.pageYOffset
}
else if (document.documentElement && document.documentElement.scrollTop) {
pos = document.documentElement.scrollTop
}
else if (document.body) {
pos = document.body.scrollTop;
}
pos=pos-tips.offsetTop+theTop;
pos=tips.offsetTop+pos/;
if (pos < theTop) pos = theTop;
if (pos != old) {
tips.style.top = pos+"px";
tt=;
}
old = pos;
setTimeout(moveTips,tt);
}
//!]]>
</script>
<style type="text/css">
<!--html {font-size: %;}body {padding:;margin:.5em;color:#;background:#F5F5F5;}body,td,th{font-family:Microsoft YaHei,Arial,Helvetica,sans-serif,Simsun;}div#floatTips ::-webkit-scrollbar {width: 7px;height: 7px}div#floatTips ::-webkit-scrollbar-track-piece {background-color:#;-webkit-border-radius: 6px;border: 1px solid #;border-bottom-color: #;border-right-color: #}div#floatTips ::-webkit-scrollbar-thumb:vertical {background-color: #eee;-webkit-border-radius: 6px}div#floatTips ::-webkit-scrollbar-thumb:vertical:hover,div#floatTips ::-webkit-scrollbar-thumb:horizontal:hover {background-color: #fff}div#floatTips ::-webkit-scrollbar-thumb:vertical:active,,div#floatTips ::-webkit-scrollbar-thumb:horizontal:active {background-color: #aaa}div#floatTips ::-webkit-scrollbar-thumb:horizontal {background-color: #eee;-webkit-border-radius: 6px}div#floatTips ::-webkit-scrollbar-button:start:decrement,div#floatTips ::-webkit-scrollbar-button:end:increment {display: block;background-color: transparent}div#floatTips ::-webkit-scrollbar-corner {background-color: transparent}h2 {font-size:%;font-weight:bold;}table td {padding:3px}table tr.odd th,.odd {background: #E5E5E5;}table tr.even th,.even {background: #D5D5D5;}table tr.odd th,table tr.odd,table tr.even th,table tr.even {text-align:left;}.odd:hover,.even:hover,.hover {background: #CCFFCC;color: #;}table tr.odd:hover th,table tr.even:hover th,table tr.hover th {background:#CCFFCC;color:#;}div#floatTips{ position:absolute;border:solid 1px #;padding:3px;top:50px;right:15px;width:200px;background:#;color:white;opacity: 0.8;filter:alpha(opacity=);color:#fff;-webkit-box-shadow: 20px rgba(,,,0.5);-webkit-border-radius: 5px;text-shadow: 1px #;-moz-box-shadow: 20px rgba(,,,0.5);-moz-border-radius: 10px;border-radius: 5px;box-shadow: 20px rgba(,,,0.5);}div#floatTips ul{padding:0px;margin:3px;height:400px; overflow-y:auto}div#floatTips ul li{ list-style:none; height:20px; width:%; line-height:20px; text-overflow:ellipsis;overflow:hidden; white-space:nowrap;}div#floatTips a:link,div#floatTips a:hover,div#floatTips a:visited,div#floatTips a:active{color:#fff; text-decoration:none}-->
</style>
<head>
<body onload="initFloatTips()">
<a name="top"></a>';
echo $html;
echo $header_index;
echo '</body></html>'; ?>

.

root

2020数据字典php-直接复制的更多相关文章

  1. 2020年,为什么我们应该使用abapGit代替SAPLink

    SAPLink是一个帮助人们分享开发内容的工具.通过它,人们可以将ABAP开发对象从一个系统打包下载.再上传到另一个系统中.对于各种类型的开发者,它都可以起到作用: 有的开发者喜欢在不同的项目中复制相 ...

  2. 2020.11最新JAVA环境安装配置

    Windows10下java环境配置 更新:2020年11月25日 电脑环境: windows10 64位 一.下载jdk 首先到Oracle网站下载对应操作系统的jdk安装包. https://ww ...

  3. 图书管理系统(Java实现,十个数据表,含源码、ER图,超详细报告解释,2020.7.11更新)

    图书管理系统数据库设计实验报告 文章目录 更新日志 1.概述 2.需求分析 2.1需要实现的功能 2.2业务流程图 2.2.1学生流程图 2.2.2管理员流程图 2.2.3超级管理员流程图 2.3功能 ...

  4. Oracle数据字典

    数据字典-简介 Oracle数据字典的名称由前缀和后缀组成,使用下划线"_"连接,其代表的含义如下: ● DBA_:包含数据库实例的所有对象信息. ● V$_:当前实例的动态视图, ...

  5. postgresql 导出数据字典文档

    项目上需要整理目前数据库的数据字典文档.项目不规范,这种文档只要后期来补.这么多张表,每个字段都写到word文档里真心头大.就算前面写了个查询表结构的sql,但是最后整理到word里还是感觉有点麻烦. ...

  6. 基于表的数据字典构造MySQL建表语句

    表的数据字典格式如下: 如果手动写MySQL建表语句,确认麻烦,还不能保证书写一定正确. 写了个Perl脚本,可快速构造MySQL脚本语句. 脚本如下: #!/usr/bin/perl use str ...

  7. 使用 PowerDesigner 和 PDMReader 逆向生成 MySQL 数据字典

    下面提到的软件大家可以在下面的链接下载. 大家可以参考下面的操作录制视频来完成相关的操作. 使用 PowerDesigner 和 PDMReader 逆向生成 MySQL 数据字典.wmv_免费高速下 ...

  8. 【Java EE 学习 30】【闪回】【导入导出】【管理用户安全】【分布式数据库】【数据字典】【方案】

    一.闪回 1.可能的误操作 (1)错误的删除了记录 (2)错误的删除了表 (3)查询历史记录 (4)撤销已经提交了的事务. 2.对应着以上四种类型的误操作,有四种闪回类型 (1)闪回表:将表回退到过去 ...

  9. 数据字典生成工具之旅(5):DocX组件读取与写入Word

    由于上周工作比较繁忙,所以这篇文章等了这么久才写(预告一下,下一个章节正式进入NVelocity篇,到时会讲解怎么使用NVelocity做一款简易的代码生成器,敬请期待!),好了正式进入本篇内容. 这 ...

随机推荐

  1. 并查集——奇偶性(Parity)

    题目描述 •有一个01序列,长度<=1000000000,现在有n条信息,每条信息的形式是-a b even/odd.表示第a位到第b位元素之间的元素总和是偶数/奇数. •你的任务是对于这些给定 ...

  2. Python读取字典(Dictionary)内数据的方法

    读取json后,数据类型为字典,对字典内数据的提取又有不同的方法,根据不同的字典类型 上图可以看到有”[]”,”{}” python语言最常见的括号有三种,分别是:小括号( ).中括号[ ]和大括号也 ...

  3. ios--->NSNotificationCenter传值

    object实现 //在发送通知时设置object参数 [[NSNotificationCenter defaultCenter] postNotificationName:@"ThisIs ...

  4. CUDA学习(六)之使用共享内存(shared memory)进行归约求和(M个包含N个线程的线程块)

    在https://www.cnblogs.com/xiaoxiaoyibu/p/11402607.html中介绍了使用一个包含N个线程的线程块和共享内存进行数组归约求和, 基本思路: 定义M个包含N个 ...

  5. 【转载】计算机程序的思维逻辑 (82) - 理解ThreadLocal

    本节,我们来探讨一个特殊的概念,线程本地变量,在Java中的实现是类ThreadLocal,它是什么?有什么用?实现原理是什么?让我们接下来逐步探讨. 基本概念和用法 线程本地变量是说,每个线程都有同 ...

  6. OpenStack之虚拟机热迁移

    这里的环境是centos7版本,openstack K版 1.在各个计算节点设置权限 chmod /var/lib/nova/instances 2.修改各个节点的nova.conf(/etc/nov ...

  7. 初探 Node.js 框架:eggjs (环境搭配篇)

    eggjs 是一个优秀的 Node.js 框架 概述:为什么标题上说 eggjs 是一个优秀的 Node.js 框架(可跳过)? 换言之,我们为什么选择 eggjs 进行开发而不是之前初学时使用的 E ...

  8. WeChall_Training: Encodings I (Training, Encoding)

    We intercepted this message from one challenger to another, maybe you can find out what they were ta ...

  9. WeChall_PHP 0817 (PHP, Exploit)

    I have written another include system for my dynamic webpages, but it seems to be vulnerable to LFI. ...

  10. 小白学 Python 数据分析(3):Pandas (二)数据结构 Series

    在家为国家做贡献太无聊,不如跟我一起学点 Python 顺便问一下,你们都喜欢什么什么样的文章封面图,老用这一张感觉有点丑 人生苦短,我用 Python 前文传送门: 小白学 Python 数据分析( ...