PHP and SQL Server are a powerful combination, however sometimes data stored in a text type column is truncated for no apparent reason after 4096 characters.
I got this problem today when I want to display text data from SQL Server 2000. Apparently, I need to increase the maximum size of a text column to be returned from SQL Server by PHP. Since I have control over the Web Server. Here is how I fixed the problem.
Search php.ini and find the lines
;mssql.textlimit = 4096
;mssql.textsize = 4096
Replace the value to 2147483647 like this:
mssql.textlimit = 2147483647
mssql.textsize = 2147483647
Also you can do the following just after making a connection.
mssql_query("SET TEXTSIZE 2147483647");
<pre><code> String foo = "bar"; </code></pre>