1. 程式人生 > >利用PHP腳本輔助MySQL數據庫管理1-表結構

利用PHP腳本輔助MySQL數據庫管理1-表結構

l數據庫 ext etc clas ray RR 管理 array color

<?php
$dbi = new DbMysql;
$dbi->dbh = ‘mysql://root:[email protected]/coffeetest‘;

$map = array();
$dbi->fetchMap("SHOW TABLES", $map);
$tables = array_keys($map);
for($i=0; $i<count($tables); $i++){
    echo($tables[$i]."\n");
    $fields = $dbi->field($tables[$i]);
    foreach($fields
as $item){ echo("\t".$item["Field"]."\t".$item["Key"]."\t".$item["Extra"]."\n"); } } ?>

利用PHP腳本輔助MySQL數據庫管理1-表結構