查出所有表名
作者:互联网
$res = pdo_fetchall('SHOW TABLES');
$aa='';
foreach($res as $k=>$v){
$aa.=$v['Tables_in_mcity'].',';
}
echo "<pre>";
var_export($aa);
die;
?>
$res = pdo_fetchall('SHOW TABLES');
$aa='';
foreach($res as $k=>$v){
// $aa.=$v['Tables_in_mcity'].',';
$str="ALTER TABLE `".$v['Tables_in_mcity']."` ADD COLUMN `cityid` int(10) NOT NULL DEFAULT 1 COMMENT '城市ID'";
pdo_fetchall($str);
echo $k;
}
// echo "<pre>";
// var_export($aa);
die;
标签:aa,fetchall,Tables,res,所有,mcity,echo,表名,查出 来源: https://www.cnblogs.com/csjoz/p/15201758.html