Binary Expressions

2009-4-28

PHP – mssql_query() Error

Filed under: — Adam @ 7:16 am

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()

4 Responses to “PHP – mssql_query() Error”

  1. Ulf Wendel says:

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

  2. Adam says:

    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. Mariner says:

    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

Leave a Reply

Take back your mailbox - CAUCE.org

Powered By Wordpress PHP: Hypertext Preprocessor MySQL Powered Download Juice, the cross-platform podcast receiver
Proud To Be Canadian Get Firefox Valid XHTML Valid CSS
<NO>OOXML Logo


26 queries. 0.356 seconds.
Copyright © 2004 - 2005 by Adam Douglas