From 079c6629083ea01e18f351a5dc0e5747b24e52e6 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Thu, 11 Dec 2003 11:16:25 +0000 Subject: [PATCH] check for databases after query --- ChangeLog | 5 ++++- sql.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 25a9619e3..ba67b5dac 100755 --- a/ChangeLog +++ b/ChangeLog @@ -10,7 +10,10 @@ $Source$ * tbl_replace.php, tbl_replace_fields.php: Fixed #857445, #857684 where non-existant fields caused PHP notices. * db_details.php: Removed unneccessary whitespace - + * sql.php: Bug #857742: When dropping the only remaining database, an + error occured. Fixed by checking if databases remein (as suggested + by lem9) + 2003-12-10 Garvin Hicking * db_datadict.php: Bug 857186: Real fix for the problem. The '@' delimiter slipped to the replacement's end instead of the expression's diff --git a/sql.php b/sql.php index 0cad3ab17..967707985 100644 --- a/sql.php +++ b/sql.php @@ -345,7 +345,7 @@ else { // This could happen if the user sends a query like "USE `database`;" $res = PMA_mysql_query('SELECT DATABASE() AS "db";'); $row = PMA_mysql_fetch_array($res); - if ($db != $row['db']) { + if (is_array($row) && isset($row['db']) && $db != $row['db']) { $db = $row['db']; $reload = 1; }