RE: [PHP-WIN] Truncating data
| From: | Robert Twitty | Date: | Wed, 28 Jul 2004 14:07:27 +0000 |
| Subject: | RE: [PHP-WIN] Truncating data | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-24271@lists.php.net to get a copy of this message | ||
You just ran into a limitation of PHP's mssql extension on Windows. This
extension was built with DB-Library, which is obsolete and does not
support the new or extended SQL Server 7.0/2000 data types. DB-Library
assumes all varchar fields have a max size of 255, which was the case for
SQL Server 6.5. varchar fields in 7.0 and 2000 have a max size of 8000,
and will be truncated to 255 by DB-Library.
Rather than changing all of your stored procedures to accomodate an old
technology, you should use ODBTP, http://odbtp.sourceforge.net. It
includes an odbtp/mssql hybrid extension that supports all of the mssql
extension's functions. Thus, you will not have to change your current PHP
scripts to use it. See http://odbtp.sourceforge.net/phpext.html#mssql.
-- bob
On Wed, 28 Jul 2004, Bowden, Zeb wrote:
> Instead of:
> SELECT varchar_field FROM table
> Try:
> SELECT convert(text,varchar_field) FROM table
>
> There might be a more efficient way but this has always worked for me...
>
> -zeb
>
>
>
> -----Original Message-----
> From: Ron.Herhuth@tatumpartners.com
> [mailto:Ron.Herhuth@tatumpartners.com]
> Sent: Wednesday, July 28, 2004 8:37 AM
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] Truncating data
>
> Hey!
>
> Okay I have a simple script that is nothing more than a query run
> against
> a Microsoft SQL Server database which returns a VARCHAR(2400) field to
> display in a text area field for user modification. The problem is that
> even though all of the data exists in the database, when it is displayed
> in the Textarea not all the data is there. I've taken care to make sure
> that all quotes are taken care of and things like that, but it still
> truncates the data.
>
> This is driving me nuts...any assistance would be greatly appreciated!
> Ron
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>