0

I have newly installed PHP 7.2.4 and Apache 2.4 on windows server 2008 r2. Everything done; i have set the paths, but problem is that when i configuring my PHP file for the connection, it gives me an error unable to connect with database. I am using codeIgniter 3.1.8.

$db['default'] = array(
    'dsn' => '', 
    'hostname' => 'localhost', 
    'username' => 'root', 
    'password' => '', 
    'database' => 'database_name', 
    'dbdriver' => 'mysqli', 
    'dbprefix' => '', 
    'pconnect' => TRUE, 
    'db_debug' => TRUE, 
    'cache_on' => FALSE 
)
James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

0

define('ENVIRONMENT','development'); This is a Codeigniter 3, database.php (non SSPI) snippet example for MSSQL 2008R2:

 define('ENVIRONMENT','development');                            
 $db['test1'] = array( 'dsn'    => '',
    'hostname' => 'MY_MSSQL_DB_FQDN\i1,10001',
    'username' => 'somemssqluser',
    'password' => 'somemssqlpassword',
    'database' => 'somedbname',
    'dbdriver' => 'sqlsrv',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);
Robot70
  • 600
  • 6
  • 10