Example #1
0
 protected function __construct($type)
 {
     $this->config = Configuration::instantiate();
     // if we need to use same credentials to the database then we need to use mysql_connect instead of mysql_pconnect.
     $this->dbId = mysql_pconnect($this->config->getConfig("DatabaseHost" . $type), $this->config->getConfig("DatabaseUser" . $type), $this->config->getConfig("DatabasePassword" . $type), true);
     if ($this->dbId > 0) {
         if (!mysql_select_db($this->config->getConfig("DatabaseDatabase" . $type), $this->dbId)) {
             exit;
         }
     }
 }