Re: [PHP] text field truncation with sql server



Thanks Richard for pointing me in the right direction. Yes, it is mssql I'm using. And changing the mssql.textlimit and mssql.textsize in the php.ini file fixed my problem.

You suggested not using all those echo statements. What do you suggest I use instead?

Thanks again!



Regards,

Bruce

"Richard Lynch" <ceo@xxxxxxxxx> 13/07/2007 5:58 p.m. >>>
What is the 3981st character?

Does your database driver, whatever it is, which you've told us is not
PDO, have any kind of limit in the buffer size of query data
back/forth?

What driver ARE you using?
I see mssql in the code, so assume that's it, right?...

Does it happen on every record at 3980?
If you don't know, add more records with enough length to find out.

PS
Using all those echo statements probably a pretty bad habit to get
into, and you probably should be using htmlentities() on each element,
before you do the nl2br...

If the 3981st character happens to be a '<' that would explain why you
aren't seeing our data... Use "View Source" in your browser if you
don't understand the preceding sentence. :-)

On Thu, July 12, 2007 11:37 pm, Bruce Cowin wrote:
I have a simple page that displays a record from the sql server
database. One of the fields is a text field and keeps getting
truncated at 3980 characters. I searched and saw someone had reported
this as a PDO bug so I'm not using PDO anymore, but I'm still getting
the truncation. Anyone know about this or have a work around? Here
is the code. It's the body field that is a text field. I've checked
the field in the database and it definitely has more data than is
displayed.

$cn = mssql_connect($myserver, $myuser, $mypwd);
mssql_select_db($mydb, $cn);
$result = mssql_query("select * from emails where id = $emailid",
$cn);
$row = mssql_fetch_array($result, MSSQL_ASSOC);

echo "<ul>";
echo "<li><b>Id:</b> " . $row['id'] . "</li>";
echo "<li><b>From:</b> " . $row['mailfrom'] . "</li>";
echo "<li><b>To:</b> " . $row['mailto'] . "</li>";
echo "<li><b>Cc:</b> " . $row['mailcc'] . "</li>";
echo "<li><b>Subject:</b> " . $row['subject'] . "</li>";
echo "<li><b>Date:</b> " . $row['sentdate'] . "</li>";
echo "<li><b>Body:</b><br> " . nl2br($row['body']) . "</li>";
echo "</ul>";

Thanks for any help.

Regards,

Bruce

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
.



Relevant Pages

  • Re: [PHP] text field truncation with sql server
    ... Does your database driver, whatever it is, which you've told us is not ... PDO, have any kind of limit in the buffer size of query data ... I see mssql in the code, so assume that's it, right?... ... On Thu, July 12, 2007 11:37 pm, Bruce Cowin wrote: ...
    (php.general)
  • DBConvert for Access & MSSQL 2.0.0
    ... DBConvert for Access & MSSQL is a database migration tool for data ... If a direct access to your MSSQL server is denied (insufficient ... privileges) you can save your data into a MSSQL Dump file to overcome ...
    (comp.software.shareware.announce)
  • Access2MSSQL PRO 1.2.0
    ... Access2MSSQL Pro is a database migration tool for data conversion from ... MS Access database to MS SQL Server and from MSSQL to ... privileges) you can save your data into a MSSQL Dump file to overcome ...
    (comp.software.shareware.announce)
  • Re: [PHP] text field truncation with sql server
    ... Does your database driver, whatever it is, which you've told us is not ... PDO, have any kind of limit in the buffer size of query data ... To unsubscribe, visit: http://www.php.net/unsub.php ... Some people have a "gift" link here. ...
    (php.general)
  • Re: PDO: Switch database user without reopening connection
    ... At the bare minimum there will be a login user who only has ... modifications to the database as well (editors get update permission, ... open PDO and create a new one, in other words disconnect from the ... a certain visitor in the Session, and use that value to start the right ...
    (comp.lang.php)