diff --git a/db_details.php3 b/db_details.php3
index fd6e73848..1b19ec7f6 100755
--- a/db_details.php3
+++ b/db_details.php3
@@ -8,6 +8,18 @@
require('./grab_globals.inc.php3');
if (!isset($message)) {
include('./header.inc.php3');
+ // Reloads the navigation frame via JavaScript if required
+ if (!empty($reload) && $reload == 'true') {
+ echo "\n";
+ ?>
+
+
diff --git a/lib.inc.php3 b/lib.inc.php3
index 8dac61bd3..fb3d24e79 100755
--- a/lib.inc.php3
+++ b/lib.inc.php3
@@ -519,7 +519,11 @@ window.parent.frames['nav'].location.replace('./left.php3?lang=' . $GLOBALS['strEdit'] . '';
+ if (isset($GLOBALS['goto']) && $GLOBALS['goto'] == 'tbl_properties.php3') {
+ $edit_link = '' . $GLOBALS['strEdit'] . '';
+ } else {
+ $edit_link = '' . $GLOBALS['strEdit'] . '';
+ }
echo ' ' . $GLOBALS['strSQLQuery'] . ' : [' . $edit_link . ']
' . "\n";
} else {
echo ' ' . $GLOBALS['strSQLQuery'] . ' :
' . "\n";
@@ -691,16 +695,14 @@ window.parent.frames['nav'].location.replace('./left.php3?lang== 2) {
- $sql = eregi_replace(
- '([^a-zA-Z0-9])'.$data[1].'\.',
- '\1 '.$data[0].'.',
- $sql);
-
+ $sql = eregi_replace(
+ '([^a-zA-Z0-9])' . $data[1] . '\.',
+ '\1 ' . $data[0] . '.',
+ $sql);
if (!isset($match)) {
- $match = $data[0].' '.$data[1];
+ $match = $data[0] . ' ' . $data[1];
}
-
- $sql = str_replace($match,' '.$data[0],$sql);
+ $sql = str_replace($match, ' ' . $data[0], $sql);
} // end if
} // end while
diff --git a/tbl_properties.php3 b/tbl_properties.php3
index af00acda6..d18634d56 100755
--- a/tbl_properties.php3
+++ b/tbl_properties.php3
@@ -12,13 +12,45 @@ if (!isset($message)) {
} else {
show_message($message);
}
+
+
+/**
+ * Defines the query to be displayed in the query textarea
+ */
+if (isset($show_query) && $show_query == 'y') {
+ // This script has been called by db_readdump.php3
+ if (isset($sql_query_cpy)) {
+ $query_to_display = $sql_query_cpy;
+ }
+ // Other cases
+ else if (get_magic_quotes_gpc()) {
+ $query_to_display = stripslashes($sql_query);
+ }
+ else {
+ $query_to_display = $sql_query;
+ }
+} else {
+ $query_to_display = '';
+}
unset($sql_query);
/**
* Selects the db that will be used during this script execution
*/
-mysql_select_db($db) or mysql_die();
+// mysql_select_db($db) or mysql_die();
+$is_db = @mysql_select_db($db);
+// Not a valid db name -> back to the welcome page
+if (!$is_db) {
+ header('Location: main.php3?lang=' . $lang . '&server=' . $server . '&reload=true');
+ exit();
+}
+$is_table = @mysql_query('SHOW TABLES LIKE \'' . sql_addslashes($table, TRUE) . '\'');
+// Not a valid table name -> back to the db_details.php3
+if (!@mysql_numrows($is_table)) {
+ header('Location: db_details.php3?lang=' . $lang . '&server=' . $server . '&db=' . urlencode($db) . '&reload=true');
+ exit();
+}
/**
@@ -30,6 +62,7 @@ $url_query = 'lang=' . $lang
. '&table=' . urlencode($table)
. '&goto=tbl_properties.php3';
+
/**
* Gets table informations
*/
@@ -52,17 +85,16 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) >= 3) {
$result = mysql_query('ALTER TABLE ' . backquote($table) . 'ORDER BY ' . $order_field) or mysql_die();
}
- // Get table type and comments
+ // Get table type and comments and displays first browse links
$result = mysql_query('SHOW TABLE STATUS LIKE \'' . sql_addslashes($table, TRUE) . '\'') or mysql_die();
$showtable = mysql_fetch_array($result);
$tbl_type = strtoupper($showtable['Type']);
- if (isset($showtable['Rows']) && $showtable['Rows']>0) {
-
- ?>
-
-
-
+ if (isset($showtable['Rows']) && $showtable['Rows'] > 0) { + echo "\n"; + ?> + +
[ ] [ @@ -72,23 +104,21 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) >= 3) { [ ]
- + echo "\n"; + ?> -+
-'; - + + + :