php生成mysql数据库数据字典php生成mysql数据库数据字典的程序代码,比较实用,具体代码如下:
$v){ $sql='select * from '; $sql.='information_schema.tables '; $sql.='where '; $sql.=table_name='{$v['table_name']}' and table_schema='{$database}'; $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}'; $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='';//循环所有表foreach($tables as $k=>$v){ $html.=''; $html.=''.$v['table_comment'].'('. $v['table_name'].')'; $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['column_comment'].($f['extra']=='auto_increment'?',自动递增':'').' '; $html.='
'; } $html.='
';}//输出echo ''.$title.'';echo ''.$title.'';echo $html;$version='made by www.phpernote.com
';echo '
'.$version.'
';
生成结果页面如下图:
您可能感兴趣的文章合理使用mysql数据库索引以使数据库高效运行php利用session_set_save_handler()函数将session保存到mysql数据库中忘记phpnow的mysql数据库密码的解决办法总结mysql数据库服务器逐渐变慢的原因和解决办法php利用array_flip实现数组键值交换去除数组重复值php mysql数据库操作类在php中分别使用curl的post提交数据的方法和get获取网页数据的方法总结关于修改mysql数据库字符集的方法
http://www.bkjia.com/phpjc/1065275.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/1065275.htmltecharticlephp生成mysql数据库数据字典 php生成mysql数据库数据字典的程序代码,比较实用,具体代码如下: ?phpheader('content-type:text/html;charset=utf-8');/**...