Add IF NOT EXISTS to CREATE DATABASE query (RFE #1608372), reload navigation after creating database.
This commit is contained in:
@@ -5,6 +5,10 @@ phpMyAdmin - ChangeLog
|
||||
$Id$
|
||||
$HeadURL$
|
||||
|
||||
2006-12-05 Michal Čihař <michal@cihar.com>
|
||||
* server_privileges.php: Add IF NOT EXISTS to CREATE DATABASE query (RFE
|
||||
#1608372), reload navigation after creating database.
|
||||
|
||||
2006-12-04 Marc Delisle <lem9@users.sourceforge.net>
|
||||
* db_structure.php, bug #1605985, missing HTML tag
|
||||
|
||||
|
@@ -836,9 +836,11 @@ if (!empty($adduser_submit) || !empty($change_copy)) {
|
||||
/* Create database for new user */
|
||||
if (isset($createdb) && $createdb > 0) {
|
||||
if ($createdb == 1) {
|
||||
$q = 'CREATE DATABASE ' . PMA_backquote(PMA_sqlAddslashes($username)) . ';';
|
||||
$q = 'CREATE DATABASE IF NOT EXISTS ' . PMA_backquote(PMA_sqlAddslashes($username)) . ';';
|
||||
$sql_query .= $q;
|
||||
PMA_DBI_try_query($q) or PMA_mysqlDie(PMA_DBI_getError(), $sql_query);
|
||||
$GLOBALS['reload'] = TRUE;
|
||||
PMA_reloadNavigation();
|
||||
|
||||
$q = 'GRANT ALL PRIVILEGES ON ' . PMA_backquote(PMA_sqlAddslashes($username)) . '.* TO \'' . PMA_sqlAddslashes($username) . '\'@\'' . $hostname . '\';';
|
||||
$sql_query .= $q;
|
||||
|
Reference in New Issue
Block a user