I have the following code below and i believe it loads the database. Atleast it will die if I change something (like the hostname string) in database.php configurations. However, I can execute the sql. This exact sql works fine in command line. I just cant figure out and the error is weird that it cant find the table when in commandline.
my_ci_code.php
db = $this->load->database('eapplication',TRUE); <-- this is ok, doesnt die
$qry_string="SELECT dbo.EAPPLICATION.DATE_COA FROM dbo.EAPPLICATION WHERE (dbo.EAPPLICATION.CODE IN (2, 3))";
$query = $this->db->query($qry_string); <-- dies here
echo "number of rows:" . $query->num_rows();
database.php
$db['eapplication']['hostname'] = 'Driver={SQL Server Native Client 11.0};Server=10.3.33.333;Database=eapplicationDB;';
$db['eapplication']['username'] = 'userA'; //'';
$db['eapplication']['password'] = 'password'; //'';
$db['eapplication']['database'] = 'eapplicationDB'; //'';
$db['eapplication']['dbdriver'] = 'odbc';
$db['eapplication']['dbprefix'] = '';
$db['eapplication']['pconnect'] = FALSE;
$db['eapplication']['db_debug'] = TRUE;
$db['eapplication']['cache_on'] = FALSE;
$db['eapplication']['cachedir'] = '';
$db['eapplication']['char_set'] = 'utf8';
$db['eapplication']['dbcollat'] = 'utf8_general_ci';
$db['eapplication']['swap_pre'] = '';
$db['eapplication']['autoinit'] = TRUE;
$db['eapplication']['stricton'] = FALSE;
ODBC MSSQL driver https://www.microsoft.com/en-us/download/details.aspx?id=28160
CENTOS 7
The error
<p>Error Number: 1146</p><p>Table 'dbo.EAPPLICATION' doesn't exist</p><p>SELECT dbo.EAPPLICATION.DATE_COA FROM dbo.EAPPLICATION WHERE (dbo.EAPPLICATION.CODE IN (2, 3))</p><p>Filename: /var/www/html/controllers/api.php</p><p>Line Number: 29</p> </div>