If you want to make sure you get the whole string and it's fairly long,
like a paragraph of characters or something, the db field should be a
text field. Varchar is definitely no longer than 255 in MSSQL. You've
lost the data over 255 chars with your current setup. 

Matt Friedman
Web Applications Developer
www.SpryNewMedia.com


-----Original Message-----
From: Niklas Lampén [mailto:[EMAIL PROTECTED]] 
Sent: Monday May 13, 2002 8:56 AM
To: Php-General
Subject: RE: [PHP] Getting only 255 chars from SQL Server

Oh, it's different in msSQL. My mistake, sorry.. :)
My knowledge is based on mySQL, I thought that the field lengths were in
some sorta standard.


Niklas



-----Original Message-----
From: Sqlcoders.com Programming Dept [mailto:[EMAIL PROTECTED]] 
Sent: 14. toukokuuta 2002 1:46
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Getting only 255 chars from SQL Server


Taken from Microsoft SQL Server 2000 Reference (Transact-SQL Reference):

varchar[(n)]

Variable-length non-Unicode character data with length of n bytes. n
must be a value from 1 through 8,000. Storage size is the actual length
in bytes of the data entered, not n bytes. The data entered can be 0
characters in length. The SQL-92 synonyms for varchar are char varying
or character varying.



----- Original Message -----
From: "Niklas Lampén" <[EMAIL PROTECTED]>
To: "Php-General" <[EMAIL PROTECTED]>
Sent: May 13 2002 05:38 AM
Subject: RE: [PHP] Getting only 255 chars from SQL Server


> The platform doesn't matter here, since VarChar's maximum length is 
> 255 chars, so everything above that is cutted away on insert. Creating

> table with VarChar(800) should give an error..
>
>
> Niklas
>
>
> -----Original Message-----
> From: Michael Sims [mailto:[EMAIL PROTECTED]]
> Sent: 13. toukokuuta 2002 15:32
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Getting only 255 chars from SQL Server
>
>
> On Sun, 12 May 2002 18:43:47 -0700, you wrote:
>
> >I have an SQL Server database running on a server on the internet. I 
> >need to have php connecting to the db and returning values. Simple 
> >stuff. No problem making the connection and getting data using the
> mssql
> >functions. The weird thing is that 4 of the fields in the table are 
> >vchar fields of length 800. When getting the data from the db for the

> >web page, all that gets returned are the first 255 characters of each

> >field.
>
> Are you using FreeTDS on *nix, or is this a Windows server making the 
> connection?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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



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

Reply via email to