Re: [PHP] text field truncation with sql server



Probably a heredoc would be easiest for what you've got.
http://php.net/>>>

The URL is not a typo.

Though your email client may mangle it... :-)

On Sun, July 15, 2007 5:02 pm, Bruce Cowin wrote:
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?

--
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: 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)
  • 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 ... If the 3981st character happens to be a '<' that would explain why you ...
    (php.general)
  • Fw: Sensible Crossposting To Genealogical, Cultural, Military And Historical Newsgroups
    ... Historical Newsgroups ... regarding the lovely portraits displayed on Leo's database. ... sincere sentiments on my part. ... To unsubscribe from the list, please send an email to GEN-MEDIEVAL-request@xxxxxxxxxxxx with the word 'unsubscribe' without the quotes in the subject and the body of the message ...
    (soc.genealogy.medieval)
  • Re: PDO: Switch database user without reopening connection
    ... the postgres user they are logged in as to one that can make ... modifications to the database as well (editors get update permission, ... open PDO and create a new one, in other words disconnect from the ... As database connections are expensive to ...
    (comp.lang.php)
  • 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?... ... the truncation. ...
    (php.general)