0

I am fetching a column from MSSQL table, the data-type of which ntext. When this column is null or has less data, script is working properly, but with large data, it just truncates, without any error or exception.

I am using odbc_fetch_array, to get data from result-set. I have tried various solutions, but none of them is working.

$sql = "select top 40 v.vendorID, v.userID, v.companyName, v.contactName, v.email, v.address1, v.address2 ,v.city, v.zip, v.countryID, v.stateOrRegionID, v.phone, v.fax, v.website, convert(nvarchar(max),v.profile) as profile,v.listOrder,v.logo, v.logoThumb, v.photos from custom_vendor as v order by v.listOrder ";

$rs = odbc_exec($conn, $sql);

if (!$rs) {exit(json_encode(array("error"=>"Error in SQL")));}

while( $row = odbc_fetch_array($rs) ) {
...
}

Thanks

5
  • how many lines are we talking here? And is it truncating just whats in that column? Or is it not returning full result set? Commented Jun 27, 2014 at 9:32
  • It returns result set, but when it comes to that column, then nothing further executes...... Commented Jun 27, 2014 at 9:40
  • put some code for people. Commented Jun 27, 2014 at 9:52
  • looks like I found something very similar here stackoverflow.com/questions/16704978/… there is something related to odbc.defaultlrl = 10000 Commented Jun 27, 2014 at 9:53
  • @Darka: That is not working...... Commented Jun 27, 2014 at 10:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.