【发布时间】:2010-06-12 07:22:14
【问题描述】:
如何在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
}
?>
请帮帮我
【问题讨论】: