I was using mssql pdo for PHP 5.3.1, It was running without any problems, suddenly I have found, all my insert queries fails while running from php PDO, If I echo the query and run it in SQL server Management studio, It runs without any error. below is my echo query
INSERT INTO contactus(title, first_name, last_name, email) VALUES('Mr', 'Robin', 'Michael', 'robin@robin.com')
below is the error
Array ( [0] => HY000 [1] => 10007 [2] => Incorrect syntax near 'Mr'. [10007] (severity 5) [INSERT INTO contactus(title, first_name, last_name, email) VALUES('Mr] [3] => -1 [4] => 5 )
Can anyone please help me resolve this issue??
Finally, I have found the issue, This is because of recent windows update on my machine and our windows server. After this update mssql pdo driver throws this error. I have downloaded sqlsrv20 driver from microsoft website and placed the file
php_pdo_sqlsrv_53_ts_vc6.dll inside php extension directory and added new extension in php.ini file like extension=php_pdo_sqlsrv_53_ts_vc6.dll and changed the pdo connectivity
Note : for wamp server users needs to check php.ini in apache also and needs to add the extension in php.ini file under apache.