- get the DLL – grab latest x64.zip
-
add to your php.ini extension list: [ExtensionList] extension=php_pdo_sqlsrv_7_nts.dll
-
here’s sample call code: <?php
try { $conn = new PDO( “sqlsrv:Server= ip_address; Database = mydb “, $user, $pwd); $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); } catch(Exception $e){ die(var_dump($e)); }
$stmt = $conn->query($qry); $result = $stmt->fetchAll(); $row = $result[0]; $colval = $row[“fieldname”]; ?>