Stuart_Johnson
asked on
255 Character Strings?
Hi,
I'm told PHP has no problems with long strings, however, if I attempt to retrieve a 2000 character long string from an MS-SQL database, I'm only shown the first 255 characters of it.
Is there any reason to this at all? How do I over come this problem?
Thanks for any help you can give,
Stu
I'm told PHP has no problems with long strings, however, if I attempt to retrieve a 2000 character long string from an MS-SQL database, I'm only shown the first 255 characters of it.
Is there any reason to this at all? How do I over come this problem?
Thanks for any help you can give,
Stu
ASKER
Hi Richard,
If I do this:
echo(mssql_field_type($res ult,1));
echo(mssql_field_length($r esult,1));
I get Char 255 - which it's not. It's a char(2000).
If this is the case, should I change data types on MS-SQL? If so, what should I be using?
Thanks for the info,
Stu.
If I do this:
echo(mssql_field_type($res
echo(mssql_field_length($r
I get Char 255 - which it's not. It's a char(2000).
If this is the case, should I change data types on MS-SQL? If so, what should I be using?
Thanks for the info,
Stu.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Robert,
I changed the data type to text and it worked perfectly! Thank's very much for that!
Stu.
I changed the data type to text and it worked perfectly! Thank's very much for that!
Stu.
It's Richard and no problems! <grin>
ASKER
Hahaha. Sorry. I even got it right on the first post.
Sorry!!
Stu
Sorry!!
Stu
There is a function you can get the type with ...
string mssql_field_type ( int result [, int offset])
So,
echo mssql_field_type($results,
would show the type of the first column in the result set.
You may find that the field is set to be a small text field of some type, so only 255 characters are being stored.
Try using another client to get the data out, maybe something like MSQuery or even Excel/Word via ODBC, or something, so you can see the data.
Richard.