Author: Wenlong Wu
1. For MS SQL SERVER database
There are two solutions, as follows:
Modify php.ini to achieve: Open php.ini, you can see mssql.textsize, mssql.textlimit Two options:
; Valid range 0 - 2147483647. Default = 4096.
; mssql.textlimit = 4096
; Valid range 0 - 2147483647. Default = 4096.
; textsize = 4096
You can see that the default configuration is 4096 bytes, which is often truncated to 4K. Change it to a suitable size, remove the semicolon in front, then save and restart the WEB server That’s it.
From the above two options, you can see that the range is: 0 - 2147483647 bytes. In fact, -1 is also acceptable. Check the PHP source code and you will find that -1 means unlimited:)
if ( MS_SQL_G(textlimit) != -1) {
sprintf(buffer, "%li", MS_SQL_G(textlimit));
if (DBSETOPT(mssql.link, DBTEXTLIMIT, buffer)==FAIL) {
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
}
}
if (MS_SQL_G(textsize) != -1) {
sprintf(buffer , "SET TEXTSIZE %li", MS_SQL_G(textsize));
dbcmd(mssql.link, buffer);
dbsqlexec(mssql.link);
dbresults(mssql.link);
}
Execute SET TEXTSIZE before querying in PHP Suitable size: Just execute
before SELECT mssql_query("SET TEXTSIZE 65536");
From the above PHP source code, you can see that SET TEXTSIZE is actually executed :)
2. For Sybase database
Since this extension does not have options like SQL SERVER to configure in php.ini, the only way is to use the second method above, that is:
Execute before SELECT
sybase_query("SET TEXTSIZE 65536");