0
How do I install or sqlsrv driver on Pdo?
<?php
function conectar(){
$pdo = null;
try {
$opcoes = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION);
$pdo = new PDO("sqlsrv:server;host=192.168.0.30\COMPASS;dbname=weset;", "sa","Cabilog2015@", $opcoes);
} catch (Exception $e) {
echo $e->getMessage();
}
return $pdo;
}
conectar();
?>
I’m getting this message in the browser:
could not find driver
In dsn PDO is mysl and you want to enable sqlsrv? After all SQL Server or Mysql?
– Maurivan
I changed it. But I already did. I hadn’t disabled the php.ini dll
– GustavoSevero