0
Good evening, I am developing a PHP application using SQL Server but I am not able to make the connection with the database. I already downloaded the driver, I’ve put the dlls in the ini of PHP, I’ve downloaded ODBC, I’ve directed the folder in ini, I’ve tried several encodings and all result in the same error. I have a short deadline and I’m unable to connect, could someone please help me?
I’m using SQL2012, PHP 43 SQLSRV driver with xampp, PHP 7.1.9
This is the code:
<?php
// Dados do banco
$dbhost = "nomedomeuddns.ddns.net\INSTANCIA,8091"; #Nome do host
$db = "IntegracaoDB"; #Nome do banco de dados
$user = "sa"; #Nome do usuário
$password = "Senha123"; #Senha do usuário
$conninfo = array("Database" => $db, "UID" => $user, "PWD" => $password);
$conn = sqlsrv_connect($dbhost, $conninfo);
?>
Enable the SQL Server extension on your
php.ini
correct. Use<?php phpinfo();
and look forphp.ini
to check the correct file and then restart the web server– Valdeir Psr
I did it, really wrong.
– Laísa Boralli