I’m facing a problem with my slim 2 application and I hope that any of you can point me in the right direction,.
I’m developing an angularjs solution and my development enviroment is this :
windows 8.1
IIS
php 5.6 ( x86-NTS-VC11)
ms sql server 2014 express
php_sqlsrv_56_nts.dll
php_pdo_sqlsrv_56_nts.dll
I have developed my api with Slim 2 and it’s working fine when I query my database (GET).
When I going to make an update (PUT) I get an error ( “could not find driver”) in my db connection function (new PDO…).
function getConnection() {
$serverName = “(local)\sqlexpress”;
$conn = new PDO( “sqlsrv:server=$serverName ; Database=mydatabase”, “myuser”, “mypassword”);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $conn;
}
I call the same function for my GET requests and it works nicely.
I’m not an MS SQL expert but it seems to me that the user owns all the permissions to update the table.
Should I change my connection string?
Is Slim acting different if the connection is opened for a PUT operations ?
I have no experience with ms sql server, but I doubt this issue has anything to do with Slim. There is no relation between the request method and a pdo connection.
I confirm that I’m able to query the MS SQL database with GET request.
I have also updated some data inside a GET request, so I’m sure that my drivers are ok.
The problem arise only when I create the PDO inside a PUT request.
In example I wrote this test function: