note 55538 added to function.odbc-longreadlen
| From: | php dot net dot notes at webqs dot com | Date: | Sat, 06 Aug 2005 13:12:20 +0000 |
| Subject: | note 55538 added to function.odbc-longreadlen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-93163@lists.php.net to get a copy of this message | ||
Hi
If you are experiencing troubles with truncated and/or strangely encoded data when using PHP with MS
SQL via ODBC try setting odbc.defaultlrl ( in php.ini or via ini_set() ) to a largish number, say
65536, as stated in the other notes here.
The trick is to know how long your data is going to be, so you may want to provide some overhead.
Unfortunately you have to know how long your piece of string is before you cut it.
Doing this will allow your app to read up to this amount in one go. I'm sure there is a reason
for this behaviour but I hadn't experienced anything like it in 5 years of MySQL and Postgres
development.
If you still experience problems AND are using unicode data in the long column of your table, make
sure it is set to type "ntext", if it is "text". MSDN has some info on data
types for Unicode data.
This caused about 3 days of headaches for me, "binary" data crashing browsers and cyclical
result sets (i.e repeating data after odbc.defaultlrl bytes).
This fix was only found by poking things with sticks.
HTH
----
Manual Page -- http://www.php.net/manual/en/function.odbc-longreadlen.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55538
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55538&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55538&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55538&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55538&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55538&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55538&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55538&report=yes
Search -- http://master.php.net/manage/user-notes.php