diff --git a/ChangeLog b/ChangeLog index 49af1728f..52571c3da 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ $Source$ 2005-10-08 Michal Čihař * libraries/display_export.lib.php: Use same formatting for all options. * libraries/import/ldi.php: This one does not handle charset conversion. + * sql.php: Work even if no db set. 2005-10-07 Marc Delisle * libraries/check_user_privileges.lib.php: bug #1313821, dbname containing a diff --git a/sql.php b/sql.php index c6bbd1b7b..d16404568 100644 --- a/sql.php +++ b/sql.php @@ -364,7 +364,9 @@ else { $full_sql_query = $sql_query; } // end if...else - PMA_DBI_select_db( $db ); + if (isset($db)) { + PMA_DBI_select_db($db); + } // If the query is a DELETE query with no WHERE clause, get the number of // rows that will be deleted (mysql_affected_rows will always return 0 in