I'm trying to connect to the bank but only this error appears:
Fatal error: Uncaught PDOException: could not find driver in C: \ xampp \ htdocs \ PDO \ Example-02.php: 3 Stack trace: # 0 C: \ xampp \ htdocs \ PDO \ Example-02.php (3): PDO- > __ construct ('sqlsrv: Database ...', 'user', 'password') # 1 {main} thrown in C: \ xampp \ htdocs \ PDO \ Example-02.php on line 3
I have already downloaded the necessary drivers for php but it did not work. Follow the code (it's just a simple code to test if you're connecting)
<?php
$conn = new PDO( "sqlsrv:Database=db1;server=localhost\SQLEXPRESS;ConnectionPooling=0","usuario", "senha");
$stmt = $conn->prepare("INSERT INTO usuario(id, nome) VALUES(1,'Eddy')");
$stmt->execute();
?>
The following are the drivers used:
extension=php_pdo_sqlsrv_71_nts_x64.dll
extension=php_pdo_sqlsrv_71_nts_x86.dll
extension=php_pdo_sqlsrv_71_ts_x64.dll
extension=php_pdo_sqlsrv_71_ts_x86.dll
extension=php_sqlsrv_71_nts_x64.dll
extension=php_sqlsrv_71_nts_x86.dll
extension=php_sqlsrv_71_ts_x64.dll
extension=php_sqlsrv_71_ts_x86.dll
I will be very grateful if you can help me, I have been trying to resolve this for a while.