PHP: Getting Text to Display from ODBC Database
Increasing the Default Size of odbc.defaultlrl in the php.ini File
To solve this problem you have to increase the size of the odbc.defaultlrl setting in the php.ini file. Located about half way down in the Module Settings section. You will see the chunk of code listed for ODBC. Change the odbc.defaultlrl = 4096 to a number great enough for need. I changed it to 60000 because I needed to work with documents that were approximately 4000 words in length. Here is the sample code from the php.ini file:
[ODBC]
;odbc.default_db = Not yet implemented
;odbc.default_user = Not yet implemented
;odbc.default_pw = Not yet implemented
; Allow or prevent persistent links.
odbc.allow_persistent = On
; Check that a connection is still valid before reuse.
odbc.check_persistent = On
; Maximum number of persistent links. -1 means no limit.
odbc.max_persistent = -1
; Maximum number of links (persistent + non-persistent). -1 means no limit.
odbc.max_links = -1
; Handling of LONG fields. Returns number of bytes to variables. 0 means
; passthru.
odbc.defaultlrl = 60000
; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char.
; See the documentation on odbc_binmode and odbc_longreadlen for an explanation
; of uodbc.defaultlrl and uodbc.defaultbinmode
odbc.defaultbinmode = 1
Published by Y! Jason
I joined AC in Feb 2005. Since then I have been a part of developing the publishing platform and designing the database. View profile
- How to Install PHP-NukePHP-Nuke is another great CMS. There are many modules for PHP-Nuke that you can add to your site. I like this CMS because it looks neatly layed out and it doesn't look cluttered.
- PHP and Web Hosting with MacMany Mac users might not know that your OSX operating system comes equipped with the software required to host your own web pages. Learn how to start up your server, enable it with the easy and fun-to-use language PHP...
Using PHP for Website Navigation, ExplainedPHP can be very useful in your webiste design, I use PHP for my websites difficult functions such as forums, blogs, chat, user forms, and shopping cart interface. But did you kn...
- PHP: Reloading Your php.ini File with IIS 6 Manager
- How to Customize PHP Flag Settings Without Using Apache and Htaccess
- Introduction to PHP 5 and SimpleXML
- How to Produce Good and Resource-friendly PHP Code
- PHP Object Oriented Programming OOP for Beginners
- PHP Auction - Working with the Configuration
- How to Setup SQL Server 2005 Backups
- The ODBC long text default is 4096 bytes.
- Changes made to the php.ini file
- This helps users connecting to PHP via an ODBC connection to a MS SQL database




1 Comments
Post a CommentI have web application that was made in Codecharge using mySQL and PHP. I noticed the text output from TEXT field was being cut off at about 4000 characters.
The connection was using ODBC so when I changed "odbc.defaultlrl" value in the PHP.INI file it solved the problem.