was emptied

This commit is contained in:
Marc Delisle
2002-02-11 18:12:06 +00:00
parent d65b84a3dc
commit 89111018ad
2 changed files with 15 additions and 10 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2002-02-11 Marc Delisle <lem9@users.sourceforge.net>
* sql.php3: $table was emptied when the query was not a Select
2002-02-09 Lo<4C>c Chapeaux <lolo@phpheaven.net> 2002-02-09 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* most of the scripts: removed tabs and/or trailing spaces. * most of the scripts: removed tabs and/or trailing spaces.
* libraries/common.lib.php3; libraries/auth/cookie.auth.lib.php3: fixed css * libraries/common.lib.php3; libraries/auth/cookie.auth.lib.php3: fixed css

View File

@@ -73,18 +73,19 @@ if (isset($btnDrop) || isset($navig)) {
// query may contain aliases. // query may contain aliases.
// (todo: check for embedded comments...) // (todo: check for embedded comments...)
eregi('SELECT[[:space:]](.*)[[:space:]]FROM[[:space:]]+(`[^`]+`|[A-Za-z0-9_$]+)([\.]*)(`[^`]*`|[A-Za-z0-9_$]*)', $sql_query, $tmp); if (eregi('SELECT[[:space:]]', $sql_query)) {
eregi('SELECT[[:space:]](.*)[[:space:]]FROM[[:space:]]+(`[^`]+`|[A-Za-z0-9_$]+)([\.]*)(`[^`]*`|[A-Za-z0-9_$]*)', $sql_query, $tmp);
if ($tmp[3] == '.') { if ($tmp[3] == '.') {
$prev_db = $db; $prev_db = $db;
$db = str_replace('`', '', $tmp[2]); $db = str_replace('`', '', $tmp[2]);
$reload = ($db == $prev_db) ? 0 : 1; $reload = ($db == $prev_db) ? 0 : 1;
$table = str_replace('`', '', $tmp[4]); $table = str_replace('`', '', $tmp[4]);
}
else {
$table = str_replace('`', '', $tmp[2]);
}
} }
else {
$table = str_replace('`', '', $tmp[2]);
}
/** /**
* Sets or modifies the $goto variable if required * Sets or modifies the $goto variable if required
@@ -231,6 +232,7 @@ else {
$full_sql_query = $sql_query; $full_sql_query = $sql_query;
} // end if...else } // end if...else
mysql_select_db($db); mysql_select_db($db);
// If the query is a DELETE query with no WHERE clause, get the number of // If the query is a DELETE query with no WHERE clause, get the number of