diff --git a/ChangeLog b/ChangeLog index 4c67aaadb..0a1022a50 100644 --- a/ChangeLog +++ b/ChangeLog @@ -79,6 +79,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA - bug #1729027 Sorting results of VIEW browsing - bug #1733012 Unwanted table alias in delete button - bug #1736405 Pretty printer and HTML line breaks +- bug #1745257 Invalid DB name is still displayed 2.10.2.0 (2007-06-15) diff --git a/db_create.php b/db_create.php index 8e86c622e..ec00be636 100644 --- a/db_create.php +++ b/db_create.php @@ -10,10 +10,8 @@ */ require_once './libraries/common.inc.php'; $js_to_run = 'functions.js'; -require_once './libraries/header.inc.php'; require_once './libraries/mysql_charsets.lib.php'; - PMA_checkParameters(array('db')); /** @@ -34,13 +32,18 @@ if (!empty($db_collation) && PMA_MYSQL_INT_VERSION >= 40101) { } $sql_query .= ';'; -$result = PMA_DBI_query($sql_query); - - -/** - * Displays the result and calls default page - */ -$message = $strDatabase . ' ' . htmlspecialchars($db) . ' ' . $strHasBeenCreated; -require_once './' . $cfg['DefaultTabDatabase']; +$result = PMA_DBI_try_query($sql_query); +if (! $result) { + $message = PMA_DBI_getError(); + // avoid displaying the not-created db name in header or navi panel + $GLOBALS['db'] = ''; + $GLOBALS['table'] = ''; + require_once './libraries/header.inc.php'; + require_once './main.php'; +} else { + $message = $strDatabase . ' ' . htmlspecialchars($db) . ' ' . $strHasBeenCreated; + require_once './libraries/header.inc.php'; + require_once './' . $cfg['DefaultTabDatabase']; +} ?>