tags:

views:

113

answers:

2

Hi,

I have a MS SQL query that is selecting a field and it is being chopped off for some reason it is cutting off text at 257 characters.

Is there some kind of default cut-off for retrieving results with MSSQL and PHP?

I'm honestly clueless as to why this is happening. ANY guidance would be greatly appreciated

The field type is "char"

Here is a screen shot of my MS SQL config from phpinfo() alt text

could it be the mssql.textlimit or mssql.textsize value?

A: 

From the mysql manual:

The length of a CHAR column is fixed to the length that you declare when you create the table. The length can be any value from 0 to 255.

In my version of MYSQL, I cannot set a char field to longer than 255 characters, as per the above specification.

Is there any reason you need to use char? Try using text or blob or varchar instead.

Rupert
it's MS SQL, not MySQL
Derek Adair
A: 

Somehow the datatype is "char", which apparently is limited to 255 characters. BUT the DB is storing more than 255 characters.

Converting the field to TEXT works perfectly for some reason.

SELECT CONVERT(TEXT,fld_name) FROM TABLE_NAME

Derek Adair