Is there a straightforward solution to do the dynamic select statements against another database on the same server? I fooled around with attempting to modify the documentation example to no avail.
// Create an object of type SelectQuery and directly
// add extra detail to this query object: a condition, fields and a range
$query = db_select('custom_module_db', 'table_foo')
->condition('table_foo.id', 0, '>')
->fields(array('id', 'field_1', 'field_2'));
$result = $query->execute();
My current database setup looks like this
AWS RDS Server
->production drupal database
->Drupal Installation Tables
->custom module database
->Custom Module Tables
Clarification the below method works fine against the custom module database without adding a specific settings reference for that particular database.
So was looking to see if I can use the db_select() function in the same way as db_query() without needing to go in and add another database reference.
$data_set = db_query($query='SELECT * FROM custom_module.db.table_foo WHERE ......)
Then grabbing the resultset by
$results = $this->WeightedAverageFunction($data_set->fetchAll())