was emptied
This commit is contained in:
@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
|
||||
$Id$
|
||||
$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>
|
||||
* most of the scripts: removed tabs and/or trailing spaces.
|
||||
* libraries/common.lib.php3; libraries/auth/cookie.auth.lib.php3: fixed css
|
||||
|
22
sql.php3
22
sql.php3
@@ -73,18 +73,19 @@ if (isset($btnDrop) || isset($navig)) {
|
||||
// query may contain aliases.
|
||||
// (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] == '.') {
|
||||
$prev_db = $db;
|
||||
$db = str_replace('`', '', $tmp[2]);
|
||||
$reload = ($db == $prev_db) ? 0 : 1;
|
||||
$table = str_replace('`', '', $tmp[4]);
|
||||
if ($tmp[3] == '.') {
|
||||
$prev_db = $db;
|
||||
$db = str_replace('`', '', $tmp[2]);
|
||||
$reload = ($db == $prev_db) ? 0 : 1;
|
||||
$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
|
||||
@@ -231,6 +232,7 @@ else {
|
||||
$full_sql_query = $sql_query;
|
||||
} // end if...else
|
||||
|
||||
|
||||
mysql_select_db($db);
|
||||
|
||||
// If the query is a DELETE query with no WHERE clause, get the number of
|
||||
|
Reference in New Issue
Block a user