Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS SQL preperations?

Status
Not open for further replies.

DGK101

Programmer
Jan 9, 2003
33
ZA
Hi there,

I am about to start a project that uses PHP and MS Sql - I currently use MySql as my DB.
What I would like to know is: Do I need to prepare or carry out any changes to my current setup of PHP to be able to use MSSql as my backend DB? if so what changes do I need to make?

Also, what changes do I need to make in my PHP syntax to be able to query the DB?

Thanks, any info would be appreciated.

D
 
The PHP manual says:
Requirements

Requirements for Win32 platforms.

The extension requires the MS SQL Client Tools to be installed on the system where PHP is installed. The Client Tools can be installed from the MS SQL Server CD or by copying ntwdblib.dll from \winnt\system32 on the server to \winnt\system32 on the PHP box. Copying ntwdblib.dll will only provide access. Configuration of the client will require installation of all the tools.

Requirements for Unix/Linux platforms.

To use the MSSQL extension on Unix/Linux, you first need to build and install the FreeTDS library. Source code and installation instructions are available at the FreeTDS home page:
Note: In Windows, the DBLIB from Microsoft is used. Functions that return a column name are based on the dbcolname() function in DBLIB. DBLIB was developed for SQL Server 6.x where the max identifier length is 30. For this reason, the maximum column length is 30 characters. On platforms where FreeTDS is used (Linux), this is not a problem.

Installation

The MSSQL extension is enabled by adding extension=php_mssql.dll to php.ini.

To get these functions to work, you have to compile PHP with --with-mssql[=DIR], where DIR is the FreeTDS install prefix. And FreeTDS should be compiled using --enable-msdblib.
Read about the MS SQl functions at
Instead of mysql_query() you'll use mssql_query()
SO, if you do just basic operations it should be fine.
However, I wonder why you switch...
 
Hi there,

Thanks for all the replies. The platform I am using is Windows.

The reason for the change is that the company that has hired me to complete this project, has MS SQL. Sooo unfortunately that means I have to work with it too!!!

oh well...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top