(12-19-2016, 07:16 AM)Diederik Wrote: The CI 2.x branch has been 'End Of Life' since October 2015. In my opinion you should spend some time to upgrade your application to the 3.x branch before you ask for support. Seriously, it's time to move on.
Alot of bugs (and don't forget about security fixes!) have been resolved in all new versions. It could very well be that after you upgrade your application your database issue is already resolved.
Hello Diederik,
Thank you for your quick reply. Unfortunatelly I already tested CI3 with PDO driver and have another issue.
I can not use correct database. My settings in database.php are:
$db['mssql']['hostname'] = 'sqlsrv

erver=192.168.1.1';
$db['mssql']['username'] = 'sa';
$db['mssql']['password'] = '*******';
$db['mssql']['database'] = 'test';
$db['mssql']['dbdriver'] = 'pdo';
$db['mssql']['dbprefix'] = '';
$db['mssql']['pconnect'] = FALSE;
$db['mssql']['db_debug'] = TRUE;
$db['mssql']['cache_on'] = FALSE;
$db['mssql']['cachedir'] = '';
$db['mssql']['char_set'] = 'utf8';
$db['mssql']['dbcollat'] = 'utf8_general_ci';
$db['mssql']['swap_pre'] = '';
$db['mssql']['autoinit'] = TRUE;
$db['mssql']['stricton'] = FALSE;
$db['mssql']['failover'] = array();
and when I call any query I am still using master database not a database what I set in my settings. I have no idea what should I change to use correct database.
I can not use a full path to a database/table in my query because I use two databases. I have to have possibility to choice correct database to get some data. In old CI I used like this:
Sample configuration in database.php
one database was settings:
$db['mssql']['database'] = 'test';
....
....
....
second one:
$db['mssql_test']['database'] = 'test2';
....
....
....
in my mssql model I had in __construct
$this->test = $this->load->database('test', TRUE); // Load the db, and assign to the member var.
$this->test2 = $this->load->database('test2', TRUE); // Load the db, and assign to the member var.
when I tried to get data from first database I used:
$query = $this->test->query('select * from table');
from second
$query = $this->test2->query('select * from table');
If I use a single database I could use a query like this:
select * from [test].[dbo].[my_table]
but if I use more databases I can't.
Maybe somebody has any idea how to fix it?
Best regards,
Grzegorz
Best regards,
Grzegorz