<?xml version="1.0"?><rss version="2.0"><channel><title>Comments on SQL Server, PHP and Truncating Text - ILoveJackDaniels.com</title><link>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/</link><description>Latest comments on SQL Server, PHP and Truncating Text on ILoveJackDaniels.com</description><item><title>Comment on SQL Server, PHP and Truncating Text</title><link>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/</link><guid>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/</guid><description>Comment by Ruben Zevallos Jr. ( &lt;a href="http://www.direito2.com.br"&gt;http://www.direito2.com.br&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;I´m getting another problem... the VarChar fields with more than 255 chars cannot be used... so... this very usefull feature are not avaliable...</description></item><item><title>Comment on SQL Server, PHP and Truncating Text</title><link>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/</link><guid>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/</guid><description>Comment by Anonymous ( &lt;a href="http://"&gt;http://&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;The problem I'm experiencing is that the odbc_fetch_array (using sql server) is truncating the COLUMN name to 31 characters. Has anyone ever experienced this?</description></item><item><title>Comment on SQL Server, PHP and Truncating Text</title><link>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/</link><guid>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/</guid><description>Comment by Zaps ( &lt;a href="http://finance.clockstrikesgold.com"&gt;http://finance.clockstrikesgold.com&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;What about truncating the displayed value but keeping the full value intact in the DB?&lt;br /&gt;&lt;br /&gt;Thanks &amp; I love JD too!</description></item><item><title>Comment on SQL Server, PHP and Truncating Text</title><link>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/</link><guid>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/</guid><description>Comment by Eli Burmin ( &lt;a href="http://"&gt;http://&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;had an issue where mssql.text* settings were ignored by php. explicitly setting the values with ini_set() worked fine.</description></item><item><title>Comment on SQL Server, PHP and Truncating Text</title><link>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/</link><guid>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/</guid><description>Comment by The R ( &lt;a href="http://"&gt;http://&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;I found this didn't make a difference with my ms sql database. Neither did changing to datatypes to text as this gave issues with other pages that were trying to update the same tables.&lt;br /&gt;&lt;br /&gt;I managed to eliminate the 255 limit by setting up an odbc connection to the database. &lt;br /&gt;First you have to set up an odbc connection to the database on the server that the db exists on, I did this using IIS. In this example the odbc when set up was given the name: odbcname.&lt;br /&gt;Once you have created this on the server you need the following code(tweak to suit) in the php page/s. (All other code, for example layout and display, obviously remain the same.)&lt;br /&gt;&lt;br /&gt;#connect to db				&lt;br /&gt;$conn = odbc_connect('odbcname','username','password');&lt;br /&gt;      	if(!$conn) {exit(&quot;Err:Conn&quot;); }&lt;br /&gt;&lt;br /&gt;#Query&lt;br /&gt;$sql = &quot;select * from table&quot;;&lt;br /&gt;&lt;br /&gt;#execute&lt;br /&gt;$result = odbc_exec($conn, $sql);&lt;br /&gt;	if( !$result )&lt;br /&gt;	{ &lt;br /&gt;	exit (&quot;Could not execute Query&quot;);&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;#data retrieve&lt;br /&gt;$rowodbc = odbc_fetch_array($result);&lt;br /&gt;&lt;br /&gt;#create variables from data&lt;br /&gt;$variable =. $rowodbc[&quot;column_name&quot;];&lt;br /&gt;&lt;br /&gt;#close connection&lt;br /&gt;odbc_close( $conn );&lt;br /&gt;&lt;br /&gt;P.S I only had to change the connection type from mssql to odbc on pages that were trying to retrieve more than 255 characters, both types will work along side each other.&lt;br /&gt;&lt;br /&gt;Hope this helps</description></item><item><title>Comment on SQL Server, PHP and Truncating Text</title><link>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/</link><guid>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/</guid><description>Comment by JJ ( &lt;a href="http://"&gt;http://&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;You must edit C:\WINDOWS\php.ini and uncomment the following two lines:&lt;br /&gt;; Valid range 0 - 2147483647.  Default = 4096.&lt;br /&gt;;mssql.textlimit = 2147483647&lt;br /&gt;; Valid range 0 - 2147483647.  Default = 4096.&lt;br /&gt;;mssql.textsize = 2147483647&lt;br /&gt;&lt;br /&gt;and change them to:&lt;br /&gt;&lt;br /&gt;; Valid range 0 - 2147483647.  Default = 4096.&lt;br /&gt;mssql.textlimit = 2147483647&lt;br /&gt;&lt;br /&gt;; Valid range 0 - 2147483647.  Default = 4096.&lt;br /&gt;mssql.textsize = 2147483647</description></item><item><title>Comment on SQL Server, PHP and Truncating Text</title><link>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/</link><guid>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/</guid><description>Comment by JORGE OROZCO ( &lt;a href="http://"&gt;http://&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;manicka if u dont have a text field instead u have a varchar the limit that u still have is 255, attemp to do a cast.&lt;br /&gt;myvarchar varchar(4000)&lt;br /&gt;&lt;br /&gt;$sql=&quot;select cast (myvarcharfield as text) from mytable&quot;;&lt;br /&gt;mssql_queyr($sql);</description></item><item><title>Comment on SQL Server, PHP and Truncating Text</title><link>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/</link><guid>http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/</guid><description>Comment by manicka prakash ( &lt;a href=""&gt;&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;after that also i was not increasing the limit . then what can i do to increase the limit from 4 kb</description></item></channel></rss>