<center>
<?php
if(IsSet($_POST['Mysql'])) {
mysql_connect($_POST['Mysql']['Host'], $_POST['Mysql']['User'], $_POST['Mysql']['Pass']);
mysql_select_db($_POST['Mysql']['Db']);
$query = mysql_query("SELECT * FROM ".$_POST['Mysql']['Table']) or die(mysql_error());
while($tabel = mysql_fetch_array($query)) {
echo "<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\">\n";
foreach($tabel as $VeldNaam => $VeldInhoud) {
if(!is_int($VeldNaam)) {
echo " <tr>\n";
echo " <td>".$VeldNaam."</td>\n";
echo " <td>".$VeldInhoud."</td>\n";
echo " </tr>\n";
}
}
echo "</table>\n<br>\n";
}
echo "<a href=\"".$_SERVER['REQUEST_URI']."\">Overnieuw</a>";
} else {
?>
<form method="post">
<table border="1" cellpadding="5" cellspacing="0">
<tr>
<td>MySQL Host:</td>
<td><input type="text" name="Mysql[Host]" size="25"></td>
</tr>
<tr>
<td>MySQL User:</td>
<td><input type="text" name="Mysql[User]" size="25"></td>
</tr>
<tr>
<td>MySQL Pass:</td>
<td><input type="text" name="Mysql[Pass]" size="25"></td>
</tr>
<tr>
<td>MySQL Db:</td>
<td><input type="text" name="Mysql[Db]" size="25"></td>
</tr>
<tr>
<td>MySQL Table:</td>
<td><input type="text" name="Mysql[Table]" size="25"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="Mysql[Submit]" value="Bekijken"></td>
</tr>
</table>
</form>
<?php
}
?>
</center>
<center>
<?php
if(IsSet($_POST['Mysql'])) { mysql_connect($_POST['Mysql']['Host'], $_POST['Mysql']['User'], $_POST['Mysql']['Pass']);
echo "<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\">\n";
foreach($tabel as $VeldNaam => $VeldInhoud) {
echo " <td>".$VeldNaam."</td>\n"; echo " <td>".$VeldInhoud."</td>\n"; }
}
}
echo "<a href=\"".$_SERVER['REQUEST_URI']."\">Overnieuw</a>"; } else {
?>
<form method="post">
<table border="1" cellpadding="5" cellspacing="0">
<tr>
<td>MySQL Host:</td>
<td><input type="text" name="Mysql[Host]" size="25"></td>
</tr>
<tr>
<td>MySQL User:</td>
<td><input type="text" name="Mysql[User]" size="25"></td>
</tr>
<tr>
<td>MySQL Pass:</td>
<td><input type="text" name="Mysql[Pass]" size="25"></td>
</tr>
<tr>
<td>MySQL Db:</td>
<td><input type="text" name="Mysql[Db]" size="25"></td>
</tr>
<tr>
<td>MySQL Table:</td>
<td><input type="text" name="Mysql[Table]" size="25"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="Mysql[Submit]" value="Bekijken"></td>
</tr>
</table>
</form>
<?php
}
?>
</center>