put the port separatly from the hostname for MSSQL
This commit is contained in:
@@ -19,7 +19,8 @@ class Configuration {
|
|||||||
private $values = array(
|
private $values = array(
|
||||||
'db' => array(
|
'db' => array(
|
||||||
'driver' => 'SQL Server Native Client 11.0',
|
'driver' => 'SQL Server Native Client 11.0',
|
||||||
'server' => 'BSR2012\SQLEXPRESS,1433',
|
'server' => 'BSR2012\SQLEXPRESS',
|
||||||
|
'port' => '1433',
|
||||||
'username' => 'alcoda',
|
'username' => 'alcoda',
|
||||||
'password' => 'alcodaonly',
|
'password' => 'alcodaonly',
|
||||||
'name' => 'NetBiblio3',
|
'name' => 'NetBiblio3',
|
||||||
|
|||||||
@@ -33,9 +33,10 @@ class Connection
|
|||||||
{
|
{
|
||||||
if (is_null(self::$db)) {
|
if (is_null(self::$db)) {
|
||||||
$dsn = sprintf(
|
$dsn = sprintf(
|
||||||
"Driver={%s};Server=%s;Database=%s;",
|
"Driver={%s};Server=%s,%s;Database=%s;",
|
||||||
Configuration::get('db.driver'),
|
Configuration::get('db.driver'),
|
||||||
Configuration::get('db.server'),
|
Configuration::get('db.server'),
|
||||||
|
Configuration::get('db.port'),
|
||||||
Configuration::get('db.name')
|
Configuration::get('db.name')
|
||||||
);
|
);
|
||||||
self::$db = odbc_pconnect($dsn, Configuration::get('db.username'), Configuration::get('db.password'));
|
self::$db = odbc_pconnect($dsn, Configuration::get('db.username'), Configuration::get('db.password'));
|
||||||
|
|||||||
Reference in New Issue
Block a user