I have a simple script which works in PHP 5.6 but does not work in PHP 7.0:
$conn = new PDO("sqlsrv:Server=10.6.2.105;Database=mydb", "myuname", "mypwd"); $sql = "SELECT TOP 3 txt FROM mytab"; foreach ($conn->query($sql) as $row) print $row["txt"] . "rn";
When I run it in PHP 7.0, I get the following error:
Uncaught PDOException: could not find driver
According to http://php.net/manual/en/pdo.installation.php I don't need extension=php_pdo.dll in my php.ini file in versions above 5.3 for windows installs.
I do have the following though:
extension=php_pdo_mysql.dll extension=php_pdo_oci.dll extension=php_pdo_sqlite.dll
Also, I can use sql server directly, just not with PDO.
What else do I need to get this working? Where do I find the driver for this?
PHP 7.0.5 Windows 8.1 NTS x86