2minutes2midnight Posted March 15, 2014 Share Posted March 15, 2014 I was an ASP programmer and now trying to convert to php. I cannot get my driver to connect to the database. The issue is the same if I use PDO or the older method. Here is the connection string... try { # MS SQL Server and Sybase with PDO_DBLIB $DBH = new PDO("mssql:host=$hostname; dbname=$database;" , $username, $password); echo "Connected to Test<br>";}catch(PDOException $e) { echo "Error=" . $e->getMessage();} Here is the result... Error=could not find driver I have found this page and done everything on it but still does not connect.... http://stackoverflow.com/questions/2852748/pdoexception-could-not-find-driver Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/286984-connection-error/ Share on other sites More sharing options...
Ch0cu3r Posted March 15, 2014 Share Posted March 15, 2014 (edited) The link you posted to is for the MySQL database PDO driver. This is not the same driver for accessing an MSSQL (Microsoft SQL) database To access an MSSQL database with PDO you either have to use the ODBC PDO driver or download the MSSQL driver provided by Microsoft, linked to in the manual here Edited March 15, 2014 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/286984-connection-error/#findComment-1472689 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.