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

viv
  • 6,158
  • 6
  • 39
  • 54
  • how many lines are we talking here? And is it truncating just whats in that column? Or is it not returning full result set? – Kylie Jun 27 '14 at 09:32
  • It returns result set, but when it comes to that column, then nothing further executes...... – viv Jun 27 '14 at 09:40
  • put some code for people. – Darka Jun 27 '14 at 09:52
  • looks like I found something very similar here http://stackoverflow.com/questions/16704978/php-string-limitation-on-odbc-fetch-array there is something related to odbc.defaultlrl = 10000 – Darka Jun 27 '14 at 09:53
  • @Darka: That is not working...... – viv Jun 27 '14 at 10:20

0 Answers0