Use adminer or phpMyAdmin
You don't need to make your own. They are both opensource so you can go through it and browser around code
Easy example code (show tables & allow to delete tables)
<?php
if ($_GET['del']){
mysql_query("DROP TABLE ".$_GET['del']);
echo "done";
}
if ($_POST['password']){
$con = mysql_connect('localhost', $_POST['username'], $_POST['password']) or die("Wrong details");
mysql_select_db($_POST['db']) or die("Wrong database");
}
if ($con){
$result = mysql_query("SHOW TABLES");
while($row = mysql_fetch_row($result)){
echo "<br/>Table ".$row[0]." (<a href='?del=".$row[0]."'>Delete</a>)";
}
die();
}
?>
<form method="post" action="">
Username: <input name="username" /><br />
Password: <input name="password" /><Br />
Database: <input name="db" /><br />
<input type="submit" />
</form>