<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB"><title>Comments on SQL Server, PHP and Truncating Text - ILoveJackDaniels.com</title><link rel="alternate" type="text/html" href="http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/" /><link rel="self" type="application/xml" href="http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/atom/" /><subtitle>Latest comments on SQL Server, PHP and Truncating Text on ILoveJackDaniels.com</subtitle><author><name>Dave Child</name></author><updated>2004-12-22T10:40:00Z</updated><id>tag:ilovejackdaniels.com,2004:197</id><entry><title>Comment on SQL Server, PHP and Truncating Text</title><link rel="alternate" type="text/html" href="http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/" /><summary type="text">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...</summary><id>tag:ilovejackdaniels.com,2008:94406</id><published>2008-04-30T20:09:23+01:00</published><updated>2008-04-30T20:09:23Z</updated></entry><entry><title>Comment on SQL Server, PHP and Truncating Text</title><link rel="alternate" type="text/html" href="http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/" /><summary type="text">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?</summary><id>tag:ilovejackdaniels.com,2008:91903</id><published>2008-04-15T05:05:12+01:00</published><updated>2008-04-15T05:05:12Z</updated></entry><entry><title>Comment on SQL Server, PHP and Truncating Text</title><link rel="alternate" type="text/html" href="http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/" /><summary type="text">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!</summary><id>tag:ilovejackdaniels.com,2008:73989</id><published>2008-02-04T18:21:56+00:00</published><updated>2008-02-04T18:21:56Z</updated></entry><entry><title>Comment on SQL Server, PHP and Truncating Text</title><link rel="alternate" type="text/html" href="http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/" /><summary type="text">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.</summary><id>tag:ilovejackdaniels.com,2008:73157</id><published>2008-01-30T17:22:20+00:00</published><updated>2008-01-30T17:22:20Z</updated></entry><entry><title>Comment on SQL Server, PHP and Truncating Text</title><link rel="alternate" type="text/html" href="http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/" /><summary type="text">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</summary><id>tag:ilovejackdaniels.com,2007:20654</id><published>2007-01-08T09:46:56+00:00</published><updated>2007-01-08T09:46:56Z</updated></entry><entry><title>Comment on SQL Server, PHP and Truncating Text</title><link rel="alternate" type="text/html" href="http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/" /><summary type="text">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</summary><id>tag:ilovejackdaniels.com,2006:11591</id><published>2006-09-05T17:16:33+01:00</published><updated>2006-09-05T17:16:33Z</updated></entry><entry><title>Comment on SQL Server, PHP and Truncating Text</title><link rel="alternate" type="text/html" href="http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/" /><summary type="text">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);</summary><id>tag:ilovejackdaniels.com,2006:10174</id><published>2006-07-19T19:58:36+01:00</published><updated>2006-07-19T19:58:36Z</updated></entry><entry><title>Comment on SQL Server, PHP and Truncating Text</title><link rel="alternate" type="text/html" href="http://www.ilovejackdaniels.com/article/sql-server-php-truncating-text/comments/" /><summary type="text">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</summary><id>tag:ilovejackdaniels.com,2005:957</id><published>2005-09-28T11:23:19+01:00</published><updated>2005-09-28T11:23:19Z</updated></entry></feed>