Page 1 of 1

Trouble with mssql_fetch_array

Posted: Tue Jun 21, 2005 3:01 pm
by chewbacka
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()?

Posted: Tue Jun 21, 2005 4:22 pm
by method_man
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 :D

btw here is the exact url i got it from http://us4.php.net/function.mssql-query