PHP connection MSSQL when the nvarchar field length is truncated to 255 of the workaround, Mssqlnvarchar
This article describes a workaround for nvarchar field length truncated to 255 when PHP connects to MSSQL. Share to everyone for your reference. The specific analysis is as follows:
PHP Connection MSSQL Novice Often encounter this problem: Database inside the nvarchar field data all normal, but with PHP query out but found only 255 length, we all know, in MySQL, the length of the varchar is only 255, but MSSQL is not , PHP will not be nvarchar according to the MySQL varchar processing it.
This article gives a workaround:
Copy the code as follows: Select CAST (Target field as text) from table name
If your article table has a field summary as nvarchar, then the command is:
Copy the Code code as follows: Select CAST (summary as text) from article
For cast, the code is as follows:
Copy the Code code as follows: CAST (expression as data_type)
Expression is the Target Field
Data_type is the type of data to convert to
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/932480.html www.bkjia.com true http://www.bkjia.com/PHPjc/932480.html techarticle PHP connection MSSQL nvarchar field length is truncated to 255 of the solution, Mssqlnvarchar This example describes the PHP connection MSSQL nvarchar field length is truncated to 255 resolution method. Share to ...