Phpmssql cannot use DB-Library (such as ISQL) or ODBC3.7 or earlier

Source: Internet
Author: User
Tags mssql server
Phpmssql cannot use DB-Library (for example, ISQL) or ODBC3.7 or earlier versions. DB-Library (for example, ISQL) or ODBC3.7 or an earlier version sends ntext data or Unicode data that only uses Unicode sorting rules to the client.

Php mssql cannot use DB-Library (such as ISQL) or ODBC 3.7 or earlier versions cannot use DB-Library (such as ISQL) or ODBC 3.7 or earlier sends ntext data or Unicode data that only uses Unicode sorting rules to the client

Mssql cannot use db-library (such as isql) or odbc 3.7 or earlier
You cannot use db-library (such as isql) or odbc 3.7 or earlier versions to send ntext data or unicode data that only uses unicode sorting rules to the client.
*/
// Php mssql query statement

$ Mcn = mssql_connect ('2017. 0.0.1 ', 'sa', '1 ');
If ($ mcn)
{
Mssql_select_db ('jb ', $ mcn );
$ SQL = "select top 10 * from hellohouse_housetogo ";
$ Query = mssql_query ($ SQL );
While ($ rs = mssql_fetch_array ($ query ))
{
Print_r ($ rs );
}
}
Else
{
Echo 'fail ';
}

/*
After learning about the engine, this problem is caused by the mssql field type ntext. We can change it to varchar and then OK.

Solution 1

Select convert (varchar (255), title) as title from hellohouse_housetogo

Solution 2

Modify it to varchar on mssql server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.