Welcome Guest, Not a member yet? Register   Sign In
Connecting to MS-SQL server in CI3
#1

(This post was last modified: 02-10-2015, 06:22 PM by Rafa.)

I'm migrating a CI2 instance to the CI3 RC2 , now i'm experimenting a problem where everytime i send queries to the Database Query methods return 0 rows, i've tested my Queries (everything is OK). Thats because i'm concluding that must be something in connection configuration.

PHP shows no Database Errors.

Anyone has an idea on whats hapenning here ? ...

CI2 Configuration
PHP Code:
// ------- Default -------- //
$db['default']['hostname'] = 'Driver={SQL Server Native Client 10.0};Server=localhost;Database=comunicaciones;';
$db['default']['username'] = '[Database Username]';
$db['default']['password'] = '[Database Password]';
$db['default']['database'] = 'comunicaciones';
$db['default']['dbdriver'] = 'odbc';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = FALSE;
$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

CI3 Configuration
PHP Code:
$db['default'] = array(
    
'dsn'    => 'Driver={SQL Server Native Client 10.0};Server=localhost;Database=comunicaciones;',
    
'hostname' => '',
    
'username' => '[Database Username]',
    
'password' => '[Database Password]',
    
'database' => '',
    
'dbdriver' => 'odbc',
    
'dbprefix' => '',
    
'pconnect' => FALSE,
    
'db_debug' => TRUE,
    
'cache_on' => FALSE,
    
'cachedir' => 'application/cache',
    
'char_set' => 'utf8',
    
'dbcollat' => 'utf8_general_ci',
    
'swap_pre' => '',
    
'autoinit' => TRUE,
    
'encrypt' => FALSE,
    
'compress' => FALSE,
    
'stricton' => FALSE,
    
'failover' => array(),
    
'save_queries' => TRUE
); 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB