added the final steps needed for creating the database for the user

This commit is contained in:
seek3r 2001-06-01 09:06:49 +00:00
parent 0c41c058d1
commit dbfe053e66
2 changed files with 7 additions and 7 deletions

View File

@ -443,7 +443,7 @@ class db {
return $return;
}
function create_database($dbname, $adminname = "", $adminpasswd = "") {
function create_database($adminname = "", $adminpasswd = "") {
$currentUser = $this->User;
$currentPassword = $this->Password;
$currentDatabase = $this->Database;
@ -455,8 +455,8 @@ class db {
$this->Database = "mysql";
}
$this->disconnect();
$this->query("CREATE DATABASE $dbname");
$this->query("grant all on $dbname.* to $currentUser@localhost identified by '$currentPassword'");
$this->query("CREATE DATABASE $currentDatabase");
$this->query("grant all on $currentDatabase.* to $currentUser@localhost identified by '$currentPassword'");
$this->disconnect();
$this->User = $currentUser;

View File

@ -322,7 +322,7 @@ class db {
return $return;
}
function create_database($dbname, $adminname = "", $adminpasswd = "") {
function create_database($adminname = "", $adminpasswd = "") {
$currentUser = $this->User;
$currentPassword = $this->Password;
$currentDatabase = $this->Database;
@ -334,8 +334,8 @@ class db {
$this->Database = "mysql";
}
$this->disconnect();
$this->query("CREATE DATABASE $dbname");
$this->query("grant all on $dbname.* to $currentUser@localhost identified by '$currentPassword'");
$this->query("CREATE DATABASE $currentDatabase");
$this->query("grant all on $currentDatabase.* to $currentUser@localhost identified by '$currentPassword'");
$this->disconnect();
$this->User = $currentUser;