5
I have an error when connecting the database in my Codeigniter project, I am using SQL Server.
$db['sql'] = array(
'dsn' => 'DRIVER={SQL Server}; SERVER=HOSTPT-01407; DATABASE=localidade;',
'hostname' => 'HOSTPT-01407',
'username' => 'user123',
'password' => 'password',
'database' => 'localidade',
'dbdriver' => 'odbc',
'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) ;
The error that appears is as follows:
**A Database Error Occurred**
Unable to connect to your database server using the provided settings.
Filename: C:\wamp\www\ProjetoGuiaFacil\system\database\DB_driver.php
Line Number: 124
Organize code in sublime to be readable, or any text editor or IDE you’re using.
– Fernando Henrique Quicano
Select the code and use the button
{ }
to format.– rray
or
around the code
– user28595