Please consider downloading the latest version of Internet Explorer
to experience this site as intended.
Meloria • Ever Better
Search Tools Main Menu

Using PHP to Connect to Microsoft SQL Server

Introduction | Getting Started | Limitations | More on Data Types | Troubleshooting


If you see the following behaviors or error messages, this section describes what you can do to fix the problem.

The server returns a blank page or prompts you to download a file with the extension .php.

This behavior is triggered when an incompatible datatype is passed to PHP from the MS SQL Server. Check your SELECT queries for incompatible datatypes (previously listed in the table of datatypes). CAST incompatible datatypes as real or text.

You receive the following message.

Warning: mssql_query(): message: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. (severity 16)

You attempted to select a column of type ntext. CAST as text.