|
PCCS MySQLDatabase Admin Tool version 1.3.4
|
/ -> mysqldb_checktbl.php
1 <?php
2 //////////////////////////////////////////////////////////////////////////////////////
3 // coder: cthorn
4 // mysqldb_checktbl.php
5 //
6 /************************************************************************
7 PCCS MySQLDatabase Admin Tool
8 Copyright (C) Chauncey Thorn
9
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License
12 as published by the Free Software Foundation; either version 2
13 of the License, or (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA , USA.
23 **************************************************************************/
24
25 // This script works with the 3.23.xx series of MySQL 26
27 // updated 10-23-2000 28 // -- moving to a single file for global include files 29
30 require('mysqldb_app_includes.php');
31
32 // mysql_select_db($dbname); 33
34 $res = mysql_db_query($dbname,"CHECK TABLE $tblname");
35 $ch = mysql_fetch_array($res);
36
37 if($ch["Msg_text"] != "OK") {
38 echo $ch["Msg_text"];
39 $res = mysql_query("REPAIR TABLE $tblname");
40 $fix = mysql_fetch_array($res);
41
42 if($fix["Msg_text"] != "OK") {
43 log_this("DATABASE ERROR: Unable to repair table $tblname ","dblog.txt");
44 echo "ERROR: Unable to repair table" . $fix["Msg_text"];
45 } else {
46 log_this("DATABASE ERROR: $tblname was repaired","dblog.txt");
47 echo "Database table repaired";
48 }
49 } else {
50 echo "Table not damaged it checkout OK!...";
51 echo "<BR><A HREF=mysqldb_info.php?action=tables&dbname=$dbname>Back to
52 Tables</A>";
53 }
54
55
56
57
58
59
60 ?>
| |