I am trying to connect to sql database in addicion to mysql, I have added
$sugar_config['db']['main'] = array(
'db_host_name' => 'localhost',
'db_host_instance' => 'SQLEXPRESS',
'db_user_name' => 'db_name',
'db_password' => 'db_pass,
'db_name' => 'db_user,
'db_type' => 'mysql',
'db_port' => '',
'db_manager' => 'MysqliManager',
);
$sugar_config['db']['secondary'] = array(
'db_host_name' => 'name',
'db_host_instance' => 'SQLEXPRESS',
'db_user_name' => 'db_user_sql',
'db_password' => 'db_pass_sql',
'db_name' => 'db_name'_sql,
'db_type' => 'mssql',
'db_port' => '1433',
'db_manager' => 'SqlsrvManager'
);
in config.override.php
When I try to access
$db = DBManagerFactory::getInstance('secondary');
$sql = "SELECT * FROM cliente WHERE cliente = 123";
$results = $db->query($sql);
I am having this error:
Mysqli_query failed.
DBManager->registerError(' Query Failed: ...', ' Query Failed: ...', true)
#2 /var/www/html/Agenda/include/database/MysqliManager.php(179): DBManager->checkError(' Query Failed: ...', true)
#3 /var/www/html/Agenda/custom/modules/Leads/controller.php(84): MysqliManager->query('SELECT * FROM c...', true)
Could you help me, please?