0

Is it possible to integrate PHP 5.6 to SQL Server 2000 Or should I downgrade to PHP 4.x to do this?

I cannot update the server version nor can I convert the database to MySQL.

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
phper
  • 33
  • 6
  • Have you tried ODBC or [MS sqlsrv drivers](https://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx)? – Machavity Jun 09 '15 at 00:37
  • I've read this [thread](http://stackoverflow.com/questions/19783613/how-to-connect-to-mssql-2000-from-php-5-3-and-up) and I guess I cannot connect with the sqlsrv 3.2. The ODBC driver gives me the error _SQL Server does not exist or access denied_ but I've configured my server to allow remote connections and I've put the right IP address of the server. I'm still trying with the ODBC driver tho. – phper Jun 09 '15 at 00:46
  • Why would you want to work with sql server 2000? use at least 2008 version instead. 2000 version is 6 feet under for quite some time now. – Zohar Peled Jun 09 '15 at 05:45
  • I'd like to work on a newer version of SQL Server, but the server in my office is not being upgraded. So I need to adapt to it. – phper Jun 16 '15 at 01:27

1 Answers1

1

I've managed to connect PHP 5.6 and SQL Server 2000. In Ubuntu, I used mssql functions and unixodbc drivers. In Windows, I used the SQL Server driver and odbc functions. And I could only use native PHP for it. (I tried with CI but it doesn't have the right config for it)

Here's the connection code for Windows:

$conn = odbc_connect("Driver={SQL Server};Server=".$server.";Database=".$database.";", $user, $password);
phper
  • 33
  • 6