Forum Moderators: coopster

Message Too Old, No Replies

PHP/MSSQL error reading more than 8,000 characters

         

jm21

5:25 pm on Feb 10, 2010 (gmt 0)

10+ Year Member



Hi guys. Am working on PHP in a SQL 2005 database. I have a table which has a text field which has more than 8000 characters. For some reason PHP does not echo more than 8,000 characters on the page, does anyone have an idea what the problem could be?

rocknbil

9:19 pm on Feb 10, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Doesn't make a whole lot of sense, my guess would be that's it's not PHP that's limiting the characters. Is it possible it's outputting more but you can't see it? For example,

<p class="some class">I'm visible</p>
<div style="oops>
<p>Here's a whole block of text that will be gone until we encounter another quote.</p>
<p style="aha">And we're visible again.</p>
</div>

This can be the result of escaped characters directly from the DB, especially if you single quote like many coders:

<p class='some class'>I'm visible</p>
<div style='oops>
<p>Here's a whole block of text that will be gone until we encounter another quote.</p>
<p style='aha'>And we're visible again.</p>
</div>

The previous might just begin with "s a whole block of text..."

Second place I'd look is mySQL via command line, see if the entire DB entry prints to STDOUT.

jm21

8:29 am on Feb 11, 2010 (gmt 0)

10+ Year Member



I stumbled on the solution on a forum. PHP will trYou need to change the following values on php.ini when using MS SQL:

mssql.textlimit
mssql.textsize

By default the text limit and size is 4096 characters, changing this limit sorts out the problem.