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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.