// Connect to the server database and select the main chamilo database.
if (!($dokeos_database_connection = @Database::connect(
array(
'server' => $_configuration['db_host'],
'username' => $_configuration['db_user'],
'password' => $_configuration['db_password'],
'persistent' => $_configuration['db_persistent_connection'] // When $_configuration['db_persistent_connection'] is set, it is expected to be a boolean type.
)))) {
if (!($conn_return = @Database::connect(
array(
'server' => $_configuration['db_host'],
'username' => $_configuration['db_user'],
'password' => $_configuration['db_password'],
'persistent' => $_configuration['db_persistent_connection'] // When $_configuration['db_persistent_connection'] is set, it is expected to be a boolean type.
)))) {
$global_error_code = 3;
// The database server is not available or credentials are invalid.