urbanpanda Posted February 17, 2011 Share Posted February 17, 2011 strings from a field(type: VARCHAR(4000)) are being truncated at 255 characters. Apparently this is how varchars work(how is that useful?). I've found these two solutions on the internet but neither of them seemed to work. first, some people thought it might be a php.ini thing, so I put this at the top of my php file: ini_set ( 'mssql.textlimit' , '65536' ); ini_set ( 'mssql.textsize' , '65536' ); that didn't work, so other people suggested using the text field type instead but these two queries return nothing, so I must be doing something wrong or this just isn't the answer: $bquery="SELECT CONVERT(TEXT,description) FROM table WHERE userID='$row[userID]'"; $bquery="SELECT CAST(description AS TEXT) FROM table WHERE userID='$row[userID]'"; Quote Link to comment https://forums.phpfreaks.com/topic/228001-mssql-query-truncating-strings/ Share on other sites More sharing options...
Jessica Posted February 17, 2011 Share Posted February 17, 2011 You need to actually change the field in the database to a TEXT. Not cast it, but go in and change it. Quote Link to comment https://forums.phpfreaks.com/topic/228001-mssql-query-truncating-strings/#findComment-1175723 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.