Jump to content

mssql query truncating strings


urbanpanda

Recommended Posts

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]'";

Link to comment
https://forums.phpfreaks.com/topic/228001-mssql-query-truncating-strings/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.