$DB_NAME = DB_START_NAME . $clinic_id;
dpr($DB_NAME);
$database_info = array(
'host' => HOST_NAME,
'database' => $DB_NAME,
'username' => HOSTUSER,
'password' => HOSTPASS,
'driver' => 'mysql',
);
Database::addConnectionInfo('flat_db', 'default', $database_info);
$key = 'flat_db';
$custom_db = Database::getConnection($DB_NAME, $key);
$sql_query = "SELECT * FROM sc_patient_appointments LIMIT 1";
$result = $custom_db->query($sql_query);
foreach ($result as $row) {
//$reaged = (array) $row; // Standard object to array
dpr($row);
}
dpr($DB_NAME);
$database_info = array(
'host' => HOST_NAME,
'database' => $DB_NAME,
'username' => HOSTUSER,
'password' => HOSTPASS,
'driver' => 'mysql',
);
Database::addConnectionInfo('flat_db', 'default', $database_info);
$key = 'flat_db';
$custom_db = Database::getConnection($DB_NAME, $key);
$sql_query = "SELECT * FROM sc_patient_appointments LIMIT 1";
$result = $custom_db->query($sql_query);
foreach ($result as $row) {
//$reaged = (array) $row; // Standard object to array
dpr($row);
}