如何从mySql中的多个数据库中选择所有表格.. 我正在执行以下步骤,但无法实现目标。如何显示来自多个数据库的所有表格
<?php
$a = "SHOW DATABASES";
$da = $wpdb->get_results($a);
foreach($da as $k){
echo '<pre>';
print_r ($k->Database);//prints all the available databases
echo '</pre>';
$nq = "USE $k->Database";//trying to select the individual database
$newda = $wpdb->get_results($nq);
$alld = "SELECT * FROM $k->Database";
$td = $wpdb->get_results($alld);
var_dump($td);//returns empty array
}
?>
请帮我
您应该选择@ cherouvim的答案正确的! – JonyD 2016-08-17 15:47:26