Different database access in C5.7
I need to present in C5 (5.7!) some data that are extracted from a different database (on the same server).
For this I have created a single_page and added some code in there:
<?php $db = Loader::db('localhost', 'db_user', 'db_pass','db_db', true); $howmany = $db->GetOne('SELECT count(*) FROM product'); print "Got: $howmany"; ?>
The problem is that I get this error:
An exception occurred while executing 'SELECT count(*) FROM product': SQLSTATE[42S02]: Base table or view not found: 1146 Table 'concrete5.product' doesn't exist
What's actually happen is that $db is connected still to the main database (I checked but replacing the table name in select with one that is in concrete5, and it works giving back the number of records).
Am I missing something?