PHP – mssql_query() Error

Background Knowledge


I’m running PHP v5.2.9-2 with SQL Server 2005 Express on Windows Server 2003 R2 SP2.

Error Message


Warning: mssql_query() [function.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)

Solution


Specify the database columns within your database query (select filed1, field2 from foo). Avoid doing queries with the wildcard (*), select * from foo.

Source: PHP Manual on MSSQL_Query()

5 thoughts on “PHP – mssql_query() Error

  1. Adam, MS SQL Server trouble on PlanetMySQL? Why would the typical MySQL audience care?

  2. Well it isn’t at all. It just so happens the posts I do for PHP and related are in one category. Most of the time its only MySQL. If its necessary I could split MySQL out on its own.

  3. I am getting the same error message if I added ‘for xml’ clause in the query. specifying the fields doesn’t help.

  4. I too am getting the same error message with the fields specified. I then tried this:

    $string = mssql_query(“SELECT CAST(TEXT ProgramName) As ProgramName FROM ProgramsRussian where ProgramId = 194;”, $connection);

    but that also didnt work

  5. First of all ,you have created a really beautiful theme . I think i might design something similar for a future blog that i want to build . In addition ,i really enjoy most of the posts and your different point of view. Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">