403 views
Hoe kan ik vanuit PHP door middel van SQL alle bestaande databases en tables binnen die databases weergeven?
<?php
mysql_connect('localhost','admin','*****');
$sqlquery = mysql_query("SHOW DATABASES");
while ($rowdb = mysql_fetch_assoc($sqlquery)){
echo '<a href="editor.php?act=sqlmanager&currdb='.$rowdb['Database'].'">
'.$rowdb['Database'].'</a><br>';
}
?><?php
$tabellen = mysql_query("SHOW TABLES IN ".$_GET['currdb'],$conn)or die(mysql_error());
while($tabel = mysql_fetch_assoc($tabellen)) {
echo $tabel['Tables_in_'.$_GET['currdb']].'<br>';
}
?>