A ja łącze się tak
define('PASSWORD_MsSQL', 'password'); define('HOST_MsSQL', 'win2k8r2')
MsSQL::instance();
public static function instance
() {
if (null === self::$_instance) {
self::$_instance = new self(USER_MsSQL,PASSWORD_MsSQL,BASE_MsSQL,ERROR_MsSQL,HOST_MsSQL);
}
return self::$_instance;
}
private function __construct($db_user = null, $db_pass = null, $db_baza = null, $showErrors = false, $db_host = 'localhost'){
$this->db_host = $db_host;
$this->db_user = $db_user;
$this->db_pass = $db_pass;
$this->db_baza = $db_baza;
$this->showErrors = $showErrors;
if(!$this->connection = @mssql_connect($this->db_host,$this->db_user,$this->db_pass)) {
throw new Exception(Reports::getMessage('dbConnect').' - '.mssql_get_last_message());
}
if(!$this->selectdb = @mssql_select_db($this->db_baza)) {
throw new Exception(Reports::getMessage('dbSelectDB').' - '.mssql_get_last_message());
}
$this->queryNo = 0;
$this->activityLog = Array(); $this->activityNo = 0;
}