?
Solved

PHP and MS SQL <Long Text> cuts off

Posted on 2004-10-20
6
Medium Priority
?
649 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 2000 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

807 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