added what i think is working code to create the pgsql database

This commit is contained in:
seek3r 2001-06-01 09:53:42 +00:00
parent 777aa59e10
commit 45eda7f54e

View File

@ -331,12 +331,15 @@ class db {
{ {
$this->User = $adminname; $this->User = $adminname;
$this->Password = $adminpasswd; $this->Password = $adminpasswd;
$this->Database = "mysql";
} }
$this->disconnect();
$this->query("CREATE DATABASE $currentDatabase"); system("createdb -h ".$this->Host." ". $currentDatabase, $outval);
$this->query("grant all on $currentDatabase.* to $currentUser@localhost identified by '$currentPassword'"); if($outval != 0)
$this->disconnect(); {
/* either the rights r not available or the postmaster is not running .... */
echo 'database creation faliure <BR>';
echo 'please setup the postreSQL database manually<BR>';
}
$this->User = $currentUser; $this->User = $currentUser;
$this->Password = $currentPassword; $this->Password = $currentPassword;