Solved

PHP and MS SQL <Long Text> cuts off

Posted on 2004-10-20
6
626 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

726 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