Welcome Guest, Not a member yet? Register   Sign In
sqlsrv-driver in CI 2.1.0
#11

[eluser]Unknown[/eluser]
@Narf, you're a super-hero! Replacing the existing db_pconnect function in system/database/drivers/sqlsrv/sqlsrv_driver.php did the trick perfectly. In case anyone else needs it, the function should now read:

Code:
function db_pconnect()   {

  $this->db_connect(TRUE);
  return $this->db_connect(TRUE);

}

and db config in application/config/database.php should read something like :

Code:
$db['default']['hostname'] = 'server\instancename';
$db['default']['username'] = 'dbusername';
$db['default']['password'] = 'dbpassword';
$db['default']['database'] = 'dbname';
$db['default']['dbdriver'] = 'sqlsrv';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

I'm using SQL Server 2012 and IIS, and I need my site to work for a long time into the future, so using the sqlsrv driver from Microsoft was the only option.




Theme © iAndrew 2016 - Forum software by © MyBB