gundambison

repair table

Jan 9th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. <?php
  2. //koneksi
  3. $con="....";//mysqli
  4. //coba bikin database sendiri dan isi table2 terserah kamu. anggap ada 5
  5. // masukkan view didalamnya anggap ada 2
  6.  
  7. $aTable=array();
  8. /****
  9. buatlah  fungsi
  10. extract semua table (only) dalam database..
  11. masukkan dalam array $aTable yg isinya hanya 5 (jgn 2)
  12. *****/
  13.  
  14.  
  15. //===lakukan proses repair/optimize
  16. foreach($aTable as $table){
  17.     $sql="optimize table '{$table}';";
  18.     $con->query($sql);
  19.     echo "\nRepair:$table";
  20.  
  21. }
  22.  
  23. /*
  24. Buatlah sesingkat mungkin
  25. */
Advertisement
Add Comment
Please, Sign In to add comment