int odbc_longreadlen ( resource result_id, int length)
(ODBC SQL types affected: LONG, LONGVARBINARY) The number of bytes returned to PHP is controlled by the parameter length. If it is set to 0, Long column data is passed through to the client. 注: Handling of LONGVARBINARY int odbc_binmode ( resource result_id, int mode)
(ODBC SQL types affected: BINARY, VARBINARY, LONGVARBINARY) 
ODBC_BINMODE_PASSTHRU: Passthru BINARY data ODBC_BINMODE_RETURN: Return as is ODBC_BINMODE_CONVERT: Convert to char and return When binary SQL data is converted to character C data, each byte (8 bits) of source data is represented as two ASCII characters. These characters are the ASCII character representation of the number in its hexadecimal form. For example, a binary 00000001 is converted to "01" and a binary 11111111 is converted to "FF". 表格 1. LONGVARBINARY handlingbinmode longreadlen result 
ODBC_BINMODE_PASSTHRU 0 passthru 
ODBC_BINMODE_RETURN 0 passthru 
ODBC_BINMODE_CONVERT 0 passthru 
ODBC_BINMODE_PASSTHRU 0 passthru 
ODBC_BINMODE_PASSTHRU >0 passthru 
ODBC_BINMODE_RETURN >0 return as is 
ODBC_BINMODE_CONVERT >0 return as char string odbc_result ( resource result_id, mixed field)
Returns the contents of the field. field can either be an integer containing the column number of the field you want; or it can be a string containing the name of the field. For example: 
$item_3 = odbc_result($Query_ID, 3);
$item_val = odbc_result($Query_ID, "val");  The first call to odbc_result() returns the value of the third field in the current record of the query result. The second function call to odbc_result() returns the value of the field whose field name is "val" in the current record of the query result. An error occurs if a column number parameter for a field is less than one or exceeds the number of columns (or fields) in the current record. Similarly, an error occurs if a field with a name that is not one of the fieldnames of the table(s) that is(are) being queried. 

解决方案 »

  1.   

    严重BS一楼照抄manual的回复!PHP手册一般人手一份的,这些函数的说明谁都知道,关键是如何正确使用。经一位朋友指点,此问题已经解决。
    odbc_binmode;与odbc_longreadlen;都可以不需要,只要在php.ini里把odbc.defaultlrl设置得足够大(缺省是4096)即可,然后就能普通的字段一样读取。本着让分数真正发挥其作用的精神,麻烦斑竹删帖或进来接受我的捐分。