Solved

PHP and MS SQL <Long Text> cuts off

Posted on 2004-10-20
6
598 Views
Last Modified: 2012-06-22
OK here's the situation,

- I'm working with PHP and Microsoft SQL
- I'm trying to display a press release on a page
- Title, abstract, date, all displays well
- The body of the press release gets cut off at the bottom

Is there a limit on the number of characters PHP can handle from MSSQL?
How do I get around this?

Thanks
0
Comment
Question by:netele
  • 3
  • 2
6 Comments
 
LVL 2

Accepted Solution

by:
ewong_111 earned 500 total points
ID: 12366399
make sure in the configuration file php.ini
mssql.textlimit is set to a larger value.. the limit is 0 - 2147483647 and the default should be 4096
or you can use the run time function init_set(string varname, string newvalue) to set it before you query the text value from the database
http://us2.php.net/manual/en/function.ini-set.php
hope this helps
0
 
LVL 2

Expert Comment

by:ewong_111
ID: 12366502
in addition.. in case your mssql extension is not on.. here's a link
http://us2.php.net/manual/en/ref.mssql.php
hope this helps
0
 

Author Comment

by:netele
ID: 12366719
Thanks!

I looked at the php.ini file and it looks like this,

; Valid range 0 - 2147483647.  Default = 4096.
;mssql.textlimit = 4096

A few questions,

- Does ";" comment the line?
- What are the implications of changing this?

Thanks again.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 2

Expert Comment

by:ewong_111
ID: 12367037
> - Does ";" comment the line?

yes, ";" comment the line

> - What are the implications of changing this?

in this case, you did not enable the mssql.dll extension for the mssql built in functions
and I guess you would be using the odbc instead
so, you can either enable the mssql.dll and take out the ";" for the mssql.textlimit and change the value or I would say it is more appropriate to change the

odbc.defaultlrl = 4096  to odbc.defaultlrl = 0 to let it pass through

hope this helps
0
 
LVL 3

Expert Comment

by:Boris Aranovich
ID: 12367691
Also, make sure that the length of the field in the MSSQL database is big enough and is not disregarding the end of the text...
0
 

Author Comment

by:netele
ID: 12383684
Thanks,

ewong_111, you say to change,

"odbc.defaultlrl = 4096  to odbc.defaultlrl = 0 to let it pass through"

So, changing it to "0" will allow for an unlimited amount of characters to go through?

Thanks.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now