标签:new 索引 sql数据库 coff item roo echo show mysql数据库
<?php $dbi = new DbMysql; $dbi->dbh = ‘mysql://root:mysql@127.0.0.1/coffeetest‘; $map = array(); $dbi->fetchMap("SHOW TABLES", $map); $tables = array_keys($map); for($i=0; $i<count($tables); $i++){ echo($tables[$i]."\n"); $sql = "SHOW INDEX FROM ".$tables[$i]; $list = $dbi->fetchAll($sql); $indexs = array(); foreach($list as $item){ $indexs[$item[‘Key_name‘]][] = $item[‘Column_name‘]; } foreach($indexs as $key=>$val){ echo("\t".$key."\t".implode(",",$val)."\n"); } } ?>
标签:new 索引 sql数据库 coff item roo echo show mysql数据库
原文地址:https://www.cnblogs.com/coffee_cn/p/8994331.html