Sorry i had some problems here is the scripts:
Form.php :
PHP Code:
<?php error_reporting (E_ALL ^ E_NOTICE); ?>
<form name="formname" method="post" action="repair.php">
<input name="db_host" value="localhost" type="text"/>
<input name="db_user" value="root" type="text"/>
<input name="db_password" type="text" value="root"/>
<input name="db_ignore" type="text" value="dbo"/>
<input type="submit" value="List_DBs_and_Tables" />
<br>
<input name="do_list" type="checkbox" value="on" checked="checked" disabled="disabled" />List
<input name="do_repair" type="checkbox"checked="checked" value="on" />Repair
<br>
</form>
<body onload="document.forms.formname.submit();">
repair.php
PHP Code:
<?php
$db_host = $_POST['db_host'];
$db_user = $_POST['db_user'];
$db_password = $_POST['db_password'];
$do_repair = $_POST['do_repair'];
$db_ignore = ($_POST['db_ignore']) ? $_POST['db_ignore'] : "nodbignore" ;
if(!$db_host || !$db_user){ die(); }
mysql_connect("$db_host","$db_user","$db_password") or die("Error: No BD Connection");
$rs = mysql_query("show databases");
while($arr=mysql_fetch_array($rs)){
echo "<h2>$arr[0]</h2><ol>";
mysql_select_db("$arr[0]");
$rs2 = mysql_query("show tables");
while($arr2=mysql_fetch_array($rs2)){
if($do_repair){
$rs4 = mysql_query("repair table `$arr2[0]`"); echo mysql_error();
$arr4=mysql_fetch_array($rs4);
}
echo "<li>$arr2[0] <b>$arr4[3]</b>";
}
echo "</ol>";
}
?>