如何快速生成MySQL数据库词典的长尾关键词?

2026-04-03 05:471阅读0评论SEO基础
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计543个文字,预计阅读时间需要3分钟。

如何快速生成MySQL数据库词典的长尾关键词?

PHP代码快速生成MySQL数据库词汇表,通常创建数据库最佳给每个字段加上注释,修改下配置文件即可+mysqlcidian.php+$v{{$sql='SELECT * FROM ';$sql .='information_schema.TABLES ';$sql .='WHERE ';$sql .='ta';

PHP代码快速生成mysql数据库词典,平常创建数据库最好给每个字段带上注释

修改下配置文件即可 mysqlcidian.php

$v) { $sql = 'SELECT * FROM '; $sql .= 'information_schema.TABLES '; $sql .= 'WHERE '; $sql .= "table_name = '{$v['TABLE_NAME']}' AND table_schema = '{$database['DB_NAME']}'"; $table_result = mysql_query($sql, $mysql_conn); while ($t = mysql_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['DB_NAME']}'"; $fields = array(); $field_result = mysql_query($sql, $mysql_conn); while ($t = mysql_fetch_array($field_result)) { $fields[] = $t; } $tables[$k]['COLUMN'] = $fields; } mysql_close($mysql_conn); $html = ''; // 循环所有表 //print_r($tables); foreach($tables as $k => $v) { $html .= '

'; $html .= ' 表名:' . $v['TABLE_NAME'] . ' ' . $v['TABLE_COMMENT'] . ' '; $html .= ' 字段名 数据类型 默认值 允许非空 自动递增 备注 '; $html .= ''; foreach($v['COLUMN'] AS $f) { $html .= ' ' . $f['COLUMN_NAME'] . ''; $html .= ' ' . $f['COLUMN_TYPE'] . ''; $html .= ' ' . $f['COLUMN_DEFAULT'] . ''; $html .= ' ' . $f['IS_NULLABLE'] . ''; $html .= ' ' . ($f['EXTRA'] == 'auto_increment'?'是':' ') . ''; $html .= ' ' . $f['COLUMN_COMMENT'] . ''; $html .= ' '; } $html .= '

'; } /* 生成word */ // header ( "Content-type:application/vnd.ms-word" ); // header ( "Content-Disposition:attachment;filename={$database['DB_NAME']}数据字典.doc" ); /* 生成excel*/ header ( "Content-type:application/vnd.ms-excel" ); header ( "Content-Disposition:attachment;filename={$database['DB_NAME']}数据字典.xls" ); // 输出 echo ' 自动生成数据字典 '; echo '

'.$database['DB_NAME'].'数据字典

'; echo '

生成时间:' . date('Y-m-d H:i:s') . '

'; echo $html; echo '

总共:' . count($tables) . '个数据表

'; echo ''; ?> TIM图片20171014162513.png

如何快速生成MySQL数据库词典的长尾关键词?

本文共计543个文字,预计阅读时间需要3分钟。

如何快速生成MySQL数据库词典的长尾关键词?

PHP代码快速生成MySQL数据库词汇表,通常创建数据库最佳给每个字段加上注释,修改下配置文件即可+mysqlcidian.php+$v{{$sql='SELECT * FROM ';$sql .='information_schema.TABLES ';$sql .='WHERE ';$sql .='ta';

PHP代码快速生成mysql数据库词典,平常创建数据库最好给每个字段带上注释

修改下配置文件即可 mysqlcidian.php

$v) { $sql = 'SELECT * FROM '; $sql .= 'information_schema.TABLES '; $sql .= 'WHERE '; $sql .= "table_name = '{$v['TABLE_NAME']}' AND table_schema = '{$database['DB_NAME']}'"; $table_result = mysql_query($sql, $mysql_conn); while ($t = mysql_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['DB_NAME']}'"; $fields = array(); $field_result = mysql_query($sql, $mysql_conn); while ($t = mysql_fetch_array($field_result)) { $fields[] = $t; } $tables[$k]['COLUMN'] = $fields; } mysql_close($mysql_conn); $html = ''; // 循环所有表 //print_r($tables); foreach($tables as $k => $v) { $html .= '

'; $html .= ' 表名:' . $v['TABLE_NAME'] . ' ' . $v['TABLE_COMMENT'] . ' '; $html .= ' 字段名 数据类型 默认值 允许非空 自动递增 备注 '; $html .= ''; foreach($v['COLUMN'] AS $f) { $html .= ' ' . $f['COLUMN_NAME'] . ''; $html .= ' ' . $f['COLUMN_TYPE'] . ''; $html .= ' ' . $f['COLUMN_DEFAULT'] . ''; $html .= ' ' . $f['IS_NULLABLE'] . ''; $html .= ' ' . ($f['EXTRA'] == 'auto_increment'?'是':' ') . ''; $html .= ' ' . $f['COLUMN_COMMENT'] . ''; $html .= ' '; } $html .= '

'; } /* 生成word */ // header ( "Content-type:application/vnd.ms-word" ); // header ( "Content-Disposition:attachment;filename={$database['DB_NAME']}数据字典.doc" ); /* 生成excel*/ header ( "Content-type:application/vnd.ms-excel" ); header ( "Content-Disposition:attachment;filename={$database['DB_NAME']}数据字典.xls" ); // 输出 echo ' 自动生成数据字典 '; echo '

'.$database['DB_NAME'].'数据字典

'; echo '

生成时间:' . date('Y-m-d H:i:s') . '

'; echo $html; echo '

总共:' . count($tables) . '个数据表

'; echo ''; ?> TIM图片20171014162513.png

如何快速生成MySQL数据库词典的长尾关键词?