I attempted to connect to an Microsoft SQL
database and store html form data in it using php
but was unable to.
At first I attempted using the mssql
syntax but realized that it was abandoned past 5.2
(I'm running 5.3
). Then I attempted to connect using the sqlsrv
syntax but that required a driver and editing the php.ini file -- which I did only to receive this error message pertaining to the MS SQL Native Client:
> Connection COULD NOT be establishedArray ( [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -49 [code] => -49 [2] => This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712 [message] => This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712 ) [1] => Array ( [0] => IM002 [SQLSTATE] => IM002 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified [message] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified ) )
A phpinfo
file shows that sqlsrv
is installed and I've deleted and reinstalled the drivers and native client twice already to no avail..........
Here is the stack:
- Windows 2003 server
- IIS 6 web host
- local install of MS SQL 2008 (previously was attempting to connect to a remote MS SQL 2014 database
- PHP version 3.1.3