<?php
##############################
## MySQL Admin ##
## gemaakt door: ##
## Jacob Slomp ##
## http://jacob.slompinfo.nl##
## voor vragen ##
##############################
// config
$host="localhost";
$dbuser="root";
$dbpass="";
$db="slomp";
$achtergrond='#cccccc'; // grijs
$lettertype='arial'; // lettertype van de tekst
$lettergrootte='12'; // standaart
$linkkleur='blue'; // kleur van link
$linkhover='darkblue'; // kleur als je over de link gaat
$linkonder='none'; // link onderstreept
$linkonder2='underline'; // link onderstreept als je over de link gaat
$tekstkleur='black'; // kleur van de tekst
$frameborder='0'; // Rand van het frame 0 is niks;
$mysql='ja'; // laat de MySQL query zien ja of nee
// hier niets meer wijzigen
$status=$_GET['status'];
if($status==""){
echo "<title>MySQL Admin - ".$host."</title>";
echo "<frameset cols=140,* border=$frameborder>
<frame src='".$_SERVER['PHP_SELF']."?status=left'>
<frame src='".$_SERVER['PHP_SELF']."?status=right' name=right>
</frameset>";
} else
{ if($_GET['status']=="left")
{ echo "<h3 title='Gemaakt door: Jacob slomp\nhttp://jacob.slompinfo.nl'>MySQL Admin</h3>"; }
mysql_connect($host,$dbuser,$dbpass);
mysql_select_db($db);
echo "<STYLE>";
echo "body,tr, td { color: $tekstkleur; background-color:$achtergrond; font-size:$lettergrootte; font-family: $lettertype; }";
echo "a:link { color: $linkkleur; text-decoration: $linkonder; }";
echo "a:visited { color: $linkkleur; text-decoration: $linkonder; }";
echo "a:hover { color: $linkhover; text-decoration: $linkonder2; }";
echo "</STYLE>";
if($_GET['tabel'])
{ echo "<script>\n";
echo "window.top.document.title='MySQL Admin - ".$host." - ".$_GET['tabel']."'\n";
echo "</script>\n";
$sql="SELECT * FROM `".$_GET['tabel']."`";
$res=mysql_query($sql);
if($mysql=="ja")
{
echo "<table bgcolor=#dddddd border=0>";
echo "<tr><td><b>Mysql:</b><BR> \$sql='$sql'; </tr></td>";
echo "</table><BR>";
}
$velden=mysql_num_fields($res);
echo "<table border=1>";
echo "<tr>";
while($veld = mysql_fetch_field($res))
{ echo "<td><B>".$veld->name."</td></B>";
} echo "</tr>";
while($data=mysql_fetch_array($res))
{ echo "<tr>";
for($i=0; $i<$velden; $i++)
{ $title=htmlentities($data[$i]);
$title=str_replace("\"",""",$title);
echo "<td title=\"".$title."\">".substr(htmlentities($data[$i]),0,100)."</td>"; }
echo "</tr>"; }
echo "</table>";
echo "<br>";
if(mysql_num_rows($res)!="1")
{ echo "Er zijn ".mysql_num_rows($res)." resultaten in ".$_GET['tabel'].""; }
else { echo "Er is ".mysql_num_rows($res)." resultaat in ".$_GET['tabel'].""; }
echo "<BR>";
echo "<center><small>MySQL Admin script voor tabellen lezen<BR>Made by <a href='http://jacob.slompinfo.nl' target=_new>Jacob Slomp</small>";
} else { $tab = mysql_list_tables($db);
while ($row = mysql_fetch_row($tab)) {
echo "<a href='?tabel=$row[0]&status=right' target=right>$row[0]</a><BR>"; }}}
?>