00001 <?php
00002
00003
00004
00005
00006
00007
00008 require_once('./libraries/common.lib.php');
00009
00010 PMA_checkParameters(array('db'));
00011
00012
00017
00018 $tables = array();
00019
00020 if ($cfg['SkipLockedTables'] == TRUE) {
00021 $local_query = 'SHOW OPEN TABLES FROM ' . PMA_backquote($db);
00022 $db_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
00023
00024 if ($db_info_result != FALSE && mysql_num_rows($db_info_result) > 0) {
00025 while ($tmp = PMA_mysql_fetch_row($db_info_result)) {
00026
00027 if (preg_match('@in_use=[1-9]+@i', $tmp[1])) {
00028 $sot_cache[$tmp[0]] = TRUE;
00029 }
00030 }
00031 mysql_free_result($db_info_result);
00032
00033 if (isset($sot_cache)) {
00034 $local_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
00035 $db_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
00036 if ($db_info_result != FALSE && mysql_num_rows($db_info_result) > 0) {
00037 while ($tmp = PMA_mysql_fetch_row($db_info_result)) {
00038 if (!isset($sot_cache[$tmp[0]])) {
00039 $local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . addslashes($tmp[0]) . '\'';
00040 $sts_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
00041 $sts_tmp = PMA_mysql_fetch_array($sts_result);
00042 $tables[] = $sts_tmp;
00043 } else {
00044 $tables[] = array('Name' => $tmp[0]);
00045 }
00046 }
00047 mysql_free_result($db_info_result);
00048 $sot_ready = TRUE;
00049 }
00050 }
00051 }
00052 }
00053 if (!isset($sot_ready)) {
00054 $local_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
00055 $db_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
00056 if ($db_info_result != FALSE && mysql_num_rows($db_info_result) > 0) {
00057 while ($sts_tmp = PMA_mysql_fetch_array($db_info_result)) {
00058 $tables[] = $sts_tmp;
00059 }
00060 mysql_free_result($db_info_result);
00061 }
00062 }
00063 $num_tables = (isset($tables) ? count($tables) : 0);
00064
00068 echo '<!-- Top menu links -->' . "\n";
00069 require('./db_details_links.php');
00070
00071 ?>