Introduction to using SQL database to obtain fields in php _ PHP Tutorial

Source: Internet
Author: User
Tags how to use sql
Php introduces how to use SQL database to obtain fields. During PB development, because the ntext field is used in the database, the following error message is Prompted. after reading a large amount of information, I finally understood the problem: PB reports the following error message during PB development because the ntext field is used in the database. after reading a large amount of information, Finally understand:
PB error:
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.
----------------
In SQL server, ntext and nvarchar fields are stored in unicode encoding. Therefore, php uses mssql extension to read ntext and nvarchar fields with errors.

If the title field type is nvarchar and the content field type is ntext, the following SQL statement reports an error:
Select title, content from article

The correct statement is as follows:
Select convert (varchar (255), title) as title, convert (text, content) as content from article
Or do not use the ntext field
This is very useful and solves my problem!

In the ntext field, the following error message is displayed. after a long time when the solution cannot be found, check a large amount of information and finally understand: PB reports...

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.