wai to fix mysql database remote

Results 1 to 5 of 5
  1. #1

    wai to fix mysql database remote

    <?php error_reporting (E_ALL ^ E_NOTICE); ?><form method="post">
    <input name="db_host" value="localhost" type="text"/>
    <input name="db_user" value="user" type="text"/>
    <input name="db_password" type="text" value="pasword"/>
    <input name="db_ignore" type="text" value="information_schema"/>
    <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_analyze" type="checkbox" value="on" />Analyze
    <input name="do_repair" type="checkbox" value="on" />Repair
    <br>
    </form>


    <?php

    $db_host = $_POST['db_host'];
    $db_user = $_POST['db_user'];
    $db_password = $_POST['db_password'];

    $do_analyze = $_POST['do_analyze'];
    $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_analyze){
    $rs3 = mysql_query("analyze table `$arr2[0]`"); echo mysql_error();
    $arr3=mysql_fetch_array($rs3);
    }

    if($do_repair){
    $rs4 = mysql_query("repair table `$arr2[0]`"); echo mysql_error();
    $arr4=mysql_fetch_array($rs4);
    }

    echo "<li>$arr2[0] <i>$arr3[3]</i> <b>$arr4[3]</b>";




    }
    echo "</ol>";


    }

    ?>


  2. #2
    Black Magic Development das7002 is offline
    MemberRank
    Apr 2010 Join Date
    EarthLocation
    2,188Posts

    Re: wai to fix mysql database remote

    You are trying to accomplish what exactly with that?

  3. #3
    Don't Ask About Tideborn vixio_dv is offline
    MemberRank
    Feb 2010 Join Date
    UKLocation
    774Posts

    Re: wai to fix mysql database remote

    Quote Originally Posted by das7002 View Post
    You are trying to accomplish what exactly with that?
    its mysql repair with php to fix corrupt table
    Last edited by vixio_dv; 07-10-10 at 12:31 AM.

  4. #4
    Robb rbb138 is offline
    MemberRank
    Jan 2009 Join Date
    London, EnglandLocation
    1,241Posts

    Re: wai to fix mysql database remote

    didnt even know they could brake..

  5. #5
    Black Magic Development das7002 is offline
    MemberRank
    Apr 2010 Join Date
    EarthLocation
    2,188Posts

    Re: wai to fix mysql database remote

    Quote Originally Posted by rbb138 View Post
    didnt even know they could brake..
    People can find a way to break anything >_>



Advertisement