Trouble with mssql_fetch_array
Moderator: General Moderators
Trouble with mssql_fetch_array
Can anyone please help me. I'm developing a CRM. Frontend is PHP and backend has to be MSSQL(bosses order). I have a Comments field, varchar(5000). When I use mssql_fetch_array and print out the Comments field only part of the field is returned. Is there a limit on the length you can return in the mssql_fetch_array()?
-
method_man
- Forum Contributor
- Posts: 257
- Joined: Sat Mar 19, 2005 1:38 am
i read this in a comment on http://www.php.net
"If you're having problems trying to get data stored in a varchar column with more than 255 chars use CONVERT to change the data type to TEXT like this:
$query=mssql_query("SELECT table.id, CONVERT(TEXT, table.comment) AS comment FROM table");
Don't forget to set name for the column (AS comment) or you won't be able to retrieve the data ..."
hope that helps
btw here is the exact url i got it from http://us4.php.net/function.mssql-query
"If you're having problems trying to get data stored in a varchar column with more than 255 chars use CONVERT to change the data type to TEXT like this:
$query=mssql_query("SELECT table.id, CONVERT(TEXT, table.comment) AS comment FROM table");
Don't forget to set name for the column (AS comment) or you won't be able to retrieve the data ..."
hope that helps
btw here is the exact url i got it from http://us4.php.net/function.mssql-query