What Technologies Are Used?

Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database. But all the query work is done on the client side, I’d like to move some of this to PHP.

What driver and/or connection string is needed to connect to Sql Svr and what is the syntax to use in PHP?

Update: OK so I was definitely trying to avoid using anything to do with copying DLLs etc. I’ll look into the SQL2K5PHP driver (thanks Vincent). @jcarrascal for the sake of clarity, by “client side” I mean our application is an internal web app that runs as an HTA, with all queries done via javascript calls to an ASP which actually submits the DB request.


February 16, 2017 at 9:44 am admin_lifexite

PHP provides an extension for accessing Microsoft SQL Server databases. To use the SQL Server extension, all that is required is to activate the extension in the PHP configuration file.

Details on the MSDN page

February 16, 2017 at 9:45 am admin_lifexite

You have two options:

1) php_mssql extension : If you’d like something that has the same API mysql and mysqli has, then use the php_mssql extension. But there is a catch, the bundled ntwdblib.dll file with PHP is not working. You have to find this file from a SQL Server 2000 installation or you can find it on the Internet. This API is supposedly not very reliable but I have been using it without problem for about one year.


2) Microsoft SQL Server 2005 PHP Driver : If you’d like something more modern but which does not have the same API and is missing some important functions (mssql_num_rows). The big plus is that it is supported by Microsoft and is likely to work with a future version.


Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.