2020数据字典php-直接复制
[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'] . ' </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'] . ' ' . $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> ' . $f ['COLUMN_DEFAULT'] . '</td>';
$html .= '<td nowrap="nowrap"> ' . $f ['IS_NULLABLE'] . '</td>';
$html .= '<td>' . ($f ['EXTRA'] == 'auto_increment' ? '是' : ' ') . '</td>';
$html .= '<td> ' . $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-直接复制的更多相关文章
- 2020年,为什么我们应该使用abapGit代替SAPLink
SAPLink是一个帮助人们分享开发内容的工具.通过它,人们可以将ABAP开发对象从一个系统打包下载.再上传到另一个系统中.对于各种类型的开发者,它都可以起到作用: 有的开发者喜欢在不同的项目中复制相 ...
- 2020.11最新JAVA环境安装配置
Windows10下java环境配置 更新:2020年11月25日 电脑环境: windows10 64位 一.下载jdk 首先到Oracle网站下载对应操作系统的jdk安装包. https://ww ...
- 图书管理系统(Java实现,十个数据表,含源码、ER图,超详细报告解释,2020.7.11更新)
图书管理系统数据库设计实验报告 文章目录 更新日志 1.概述 2.需求分析 2.1需要实现的功能 2.2业务流程图 2.2.1学生流程图 2.2.2管理员流程图 2.2.3超级管理员流程图 2.3功能 ...
- Oracle数据字典
数据字典-简介 Oracle数据字典的名称由前缀和后缀组成,使用下划线"_"连接,其代表的含义如下: ● DBA_:包含数据库实例的所有对象信息. ● V$_:当前实例的动态视图, ...
- postgresql 导出数据字典文档
项目上需要整理目前数据库的数据字典文档.项目不规范,这种文档只要后期来补.这么多张表,每个字段都写到word文档里真心头大.就算前面写了个查询表结构的sql,但是最后整理到word里还是感觉有点麻烦. ...
- 基于表的数据字典构造MySQL建表语句
表的数据字典格式如下: 如果手动写MySQL建表语句,确认麻烦,还不能保证书写一定正确. 写了个Perl脚本,可快速构造MySQL脚本语句. 脚本如下: #!/usr/bin/perl use str ...
- 使用 PowerDesigner 和 PDMReader 逆向生成 MySQL 数据字典
下面提到的软件大家可以在下面的链接下载. 大家可以参考下面的操作录制视频来完成相关的操作. 使用 PowerDesigner 和 PDMReader 逆向生成 MySQL 数据字典.wmv_免费高速下 ...
- 【Java EE 学习 30】【闪回】【导入导出】【管理用户安全】【分布式数据库】【数据字典】【方案】
一.闪回 1.可能的误操作 (1)错误的删除了记录 (2)错误的删除了表 (3)查询历史记录 (4)撤销已经提交了的事务. 2.对应着以上四种类型的误操作,有四种闪回类型 (1)闪回表:将表回退到过去 ...
- 数据字典生成工具之旅(5):DocX组件读取与写入Word
由于上周工作比较繁忙,所以这篇文章等了这么久才写(预告一下,下一个章节正式进入NVelocity篇,到时会讲解怎么使用NVelocity做一款简易的代码生成器,敬请期待!),好了正式进入本篇内容. 这 ...
随机推荐
- ninject 的 实现 的 理解
mvc 用ninject 好像 有 的. 加上 ClassDiagram .ClassDiagram1.rar Represents a site on a type where a value c ...
- azure 第一弹
- 解决luajit ffi cdata引用cdata的问题
使用luajit ffi会遇到cdata引用cdata的情况.官方说明是必须手动保存所有cdata的引用,否则会被gc掉. ffi.cdef[[ struct A { int id; }; struc ...
- mysql -- collection一对多查询
数据库表 角色组表: CREATE TABLE `sso_character_group` ( `group_id` ) NOT NULL AUTO_INCREMENT COMMENT '角色组ID' ...
- [HNOI2008]GT考试(kmp,dp,矩阵乘法)
[HNOI2008]GT考试(luogu) Description 求有多少个n位的数字串不包含m位的字符串(范围 n <= 1e9 n<=1e9, m <= 20m<=20) ...
- Algorithm: 多项式乘法 Polynomial Multiplication: 快速傅里叶变换 FFT / 快速数论变换 NTT
Intro: 本篇博客将会从朴素乘法讲起,经过分治乘法,到达FFT和NTT 旨在能够让读者(也让自己)充分理解其思想 模板题入口:洛谷 P3803 [模板]多项式乘法(FFT) 朴素乘法 约定:两个多 ...
- REST 风格架构
------------------------------ 时间不多了, 抓紧做一些有意义的事情 REST 风格架构 1. 他是面向资源进行开发的 2. 他是基于HTTP 协议进行开发 ...
- 如何在国内下载Eclipse及其插件
北京理工大学 http://mirror.bit.edu.cn/eclipse/ 中国科学技术大学 http://mirrors.ustc.edu.cn/eclipse/ 大连东软信息学院 http: ...
- HDU_1176_DP
http://acm.hdu.edu.cn/showproblem.php?pid=1176 简单dp,转换后跟上一题数塔一样,注意每秒只能移动一格,还有在边缘的情况. #include<ios ...
- java13人机猜拳
public class Demo01 { public static void main(String[] args) { /* * 你同桌和你要玩游戏. * 1 剪刀,2 石头,3 布 */ // ...