"Erland Sommarskog" <so****@algonet.se> wrote in message
Note to Win32 Users: Due to a limitation in the underlying API used by
PHP (MS DbLib C API), the length of VARCHAR fields is limited to 255. If you
need to store more data, use a TEXT field instead.
(http://www.php.net/manual/en/functio...eld-length.php)
The only problem with this advice is Text fields seem to be limited to
16 characters in length, and I am having similar results in terms of
truncation with other character based fields that can store more than
255 characters.
As pointed out by Chung Leong, there is room for 2GB of data in text.
The 16 bytes you see is just a pointer.
Thus, there are all reasons to look into alternative means of connections
for PHP to MS SQL Server.
I believe the Linux PHP builds use that alternate means and the Warning
(given only on one page and not the main PHP MS SQL Server driver page as it
should have been) -- I'll be testing that later on today.
Retrieving a field in chunks may not be such a big issue, it is rare that
this will happen frequently in the app however the possibility is there on
some 60% of the fields and I do need to be able to Group and Order By on the
majority of these fields. I may just have to not support the MS SQL Server
at this time -- the goal was an app that could run on Linux and Windows
webservers and connect to just about any DB alive - its a shame that one of
the staple db's is so poorly supported by the PHP project given that I am
tied to it. My work is with non-profits and we have to be able to utilize
the licensing they already have so demanding the use of particular software
will only drive the pricing up.
Strangley I had similar issues when working with ASP and SQL Server in the
past - fields would simply not show up sometimes if they where over 255
characters in length and it is a known and documented issue that affects
'certain databases' according to MS but I have only ever seen with the SQL
Server and MSDE - never Oracle, MySQL, Postgre or even Access -- its a shame
I like the SQL Server but it seems that everytime I get contracted to use it
with a web back end I run into problems that make it a royal pain in the ass
to work with.
Thanks for the feedback,
J