After a long day struggle, I found out the answer from php.net, the user's manual. Just two line code!
$result = odbc_exec($db, $sqlstmt);
odbc_binmode($result,ODBC_BINMODE_PASSTHRU);
odbc_longreadlen($result_fom_addon, 36000);
$i = 0;
while (odbc_fetch_into($result_fom_addon,$i,$rarr)) {
printf("%s<br>\n", $rarr[0]);
}
so far, as I know, the problem only shows up when using function odbc_result_all() and odbc_fetch_into().
odbc_result() works fine for retriving a very long string variable from DB.
In the end, I have to say the code is contributed by John from jasendorf@lcounty.com, Thanks, John!
Yates