[eluser]bazianm[/eluser]
I have an application that is accessing two databases. I am loading the database within the model (no "default" database set in database.php). I am running a query and getting no errors but I am also getting no results (query in SQL Server Management Studio works fine). I profiled it and I am getting "Database driver is not currently loaded" for the queries.
First the code for the model method:
Code:
function getVendors(){
$this->output->enable_profiler(TRUE);
$db = $this->load->database('barcode', true);
$lcSQL = "SELECT DISTINCT RTRIM(LTRIM(VENDOR_NAME)) as disp, VENDOR as val " .
" FROM barcode.LOG_COMP_INVENTORY" .
" ORDER BY RTRIM(LTRIM(VENDOR_NAME))";
$query = $db->query($lcSQL);
var_dump($db);
echo "<hr><br><br>";
var_dump($query);
echo "<hr><br><br>";
$return_array = $query->row_array();
}
Now, the var_dump for $db shows an object with the database parameters. I am *assuming* that everything is fine (i.e., it is connecting OK) because I get no errors.
My query also shows an object but the rows property is NULL so $return_array is also null.
This is CI 2.1.0
Any thoughts?