
Untitled
By: a guest on
Aug 6th, 2012 | syntax:
None | size: 0.51 KB | hits: 60 | expires: Never
Connecting to MSSQL 2005 with php PDO
$host = 'NEW';
$user = 'sa';
$pass = 'mypass';
$dbname = 'mydb';
try {
$DBH = new PDO("sqlsrv:Server=$host;Database=$dbname", $user, $pass);
}
catch(PDOException $e) {
echo $e->getMessage();
}
SQLSTATE[IMSSP]: This extension requires the Microsoft SQL Server 2012 Native Client ODBC Driver to communicate with SQL Server. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712