My site is hosting on windows server and I’m using php 7.3.4 and already have installed drivers. Using these two extensions in my php.ini file:
extension=php_sqlsrv_73_nts_x64
extension=php_pdo_sqlsrv_73_nts_x64
The code I’m using is bellow. I’ve tried so many ways but none of them was success.
Please can someone give me a hand
$serverName = ip_addr_of_server;
$database = name_of_db;
$uid = user_name;
$pwd = password;
try {
$dbDB = new PDO(
"sqlsrv:Server=$serverName;Database=$database",
$uid,
$pwd
);
$dbDB->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
}