MSSQL strings truncated to 4096 characters in PHP
I found when retrieving long TEXT fields from an MSSQL database using PHP, that the response was truncated to 4096 characters. I found the solution here;
Issuing the query
1 |
SET TEXTSIZE 2147483647 |
immediately after connecting to the database fixed the problem.
But I was unable to make the php.ini settings work. I added the two settings
1 2 |
mssql.textlimit = 2147483647 mssql.textsize = 2147483647 |
to the php.ini file, and the modified settings were visible in the phpinfo() information:
1 2 |
mssql.textlimit => 2147483647 => 2147483647 mssql.textsize => 2147483647 => 2147483647 |
but the fields were still truncated.