RE: Truncating data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxx
> [mailto:Ron.Herhuth@xxxxxxxxxxxxxxxxx]
> Sent: Wednesday, July 28, 2004 8:37 AM
> To: php-windows@xxxxxxxxxxxxx
> Subject:  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
>
>
>

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux