Move back to the welcome page if the current database has been dropped

This commit is contained in:
Loïc Chapeaux
2001-08-19 00:55:58 +00:00
parent 34565035d9
commit 66f4571e8d
2 changed files with 28 additions and 11 deletions

View File

@@ -20,6 +20,11 @@ if (!isset($message)) {
// 1. Gets the list of the tables // 1. Gets the list of the tables
$tables = mysql_list_tables($db); $tables = mysql_list_tables($db);
$num_tables = @mysql_numrows($tables); $num_tables = @mysql_numrows($tables);
// Not a valid db name -> back to the welcome page
if (mysql_error() != '') {
header('Location: main.php3?lang=' . $lang . '&server=' . $server . '&reload=true');
exit();
}
// speedup view on locked tables - staybyte - 11 June 2001 // speedup view on locked tables - staybyte - 11 June 2001
if ($num_tables > 0 && MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) >= 3) { if ($num_tables > 0 && MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) >= 3) {
@@ -200,16 +205,16 @@ else if (MYSQL_MAJOR_VERSION >= 3.23 && isset($tbl_cache)) {
?> ?>
<tr bgcolor="<?php echo $cfgThBgcolor; ?>"> <tr bgcolor="<?php echo $cfgThBgcolor; ?>">
<td align="center"> <td align="center">
<b><?php echo sprintf($strTables, number_format($num_tables, 0, $number_decimal_separator, $number_thousands_separator)) . "\n"; ?></b> <b><?php echo sprintf($strTables, number_format($num_tables, 0, $number_decimal_separator, $number_thousands_separator)); ?></b>
</td> </td>
<td colspan="6" align="center"> <td colspan="6" align="center">
<b><?php echo $strSum . "\n"; ?></b> <b><?php echo $strSum; ?></b>
</td> </td>
<td align="right" nowrap="nowrap"> <td align="right" nowrap="nowrap">
<b><?php echo number_format($sum_entries, 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?></b> <b><?php echo number_format($sum_entries, 0, $number_decimal_separator, $number_thousands_separator); ?></b>
</td> </td>
<td align="right" nowrap="nowrap"> <td align="right" nowrap="nowrap">
<b><?php echo $sum_formated . ' '. $unit . "\n"; ?></b> <b><?php echo $sum_formated . ' '. $unit; ?></b>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -10,6 +10,18 @@ require('./header.inc.php3');
if (isset($message)) { if (isset($message)) {
show_message($message); show_message($message);
} }
else if (!empty($reload) && $reload == 'true') {
// Reloads the navigation frame via JavaScript if required
echo "\n";
?>
<script type="text/javascript" language="javascript1.2">
<!--
window.parent.frames['nav'].location.replace('./left.php3?lang=<?php echo $lang; ?>&server=<?php echo $server; ?>');
//-->
</script>
<?php
}
echo "\n";
/** /**
@@ -261,11 +273,11 @@ if ($server > 0
<?php echo $strReloadMySQL; ?></a>&nbsp;<?php echo show_docu('manual_Reference.html#FLUSH') . "\n"; ?> <?php echo $strReloadMySQL; ?></a>&nbsp;<?php echo show_docu('manual_Reference.html#FLUSH') . "\n"; ?>
</li> </li>
<br /><br /> <br /><br />
<?php <?php
$result = mysql_query('SELECT * FROM mysql.user'); $result = mysql_query('SELECT * FROM mysql.user');
$rows = @mysql_num_rows($result); $rows = @mysql_num_rows($result);
if (!empty($rows)) { if (!empty($rows)) {
echo "\n";
?> ?>
<li> <li>
<a href="user_details.php3?<?php echo $common_url_query; ?>&db=mysql&table=user"> <a href="user_details.php3?<?php echo $common_url_query; ?>&db=mysql&table=user">
@@ -274,10 +286,10 @@ if ($server > 0
<?php <?php
echo "\n"; echo "\n";
} }
} // end of 2.2 (no AdvAuth case) } // end of 2.2 (no AdvAuth case)
} // end of 2: if ($server > 0) } // end of 2: if ($server > 0)
?> ?>
<!-- PHP Information --> <!-- PHP Information -->
<li> <li>
<a href="phpinfo.php3" target="_new"><?php echo $strShowPHPInfo; ?></a> <a href="phpinfo.php3" target="_new"><?php echo $strShowPHPInfo; ?></a>