ID: 30043 Updated by: [EMAIL PROTECTED] Reported By: arobins at csg dot uwaterloo dot ca Status: Open Bug Type: ODBC related Operating System: Win2k or Linux PHP Version: Irrelevant New Comment:
Known issue. Was once looked into correct to provide true multi-byte support, but was side tracked. Previous Comments: ------------------------------------------------------------------------ [2004-09-09 22:08:24] arobins at csg dot uwaterloo dot ca Description: ------------ When retrieving ODBC results from Sybase SQL Anywhere 6 and 9, the column names are being truncated to 31 characters. This happens even if the column name is simply specified using sql 'AS' (i.e. "select column as a_really_long_name_that_is_longer_than_31_characters from crap" would still return "a_really_long_name_that_is_long" as the column name). Have tried in PHP 4 and 5, Win2K Server and SUSE Linux, all with same results. -- The buffer used by the odbc extension to store field names is only 32 bytes. Reproduce code: --------------- <?php $DBN = 'thedbn'; $UID = 'theuid'; $PWD = 'thepws'; $CONN = odbc_connect( $DBN, $UID, $PWD ) or die( "Cannot connect to $DBN."); $sql = "select * from crap"; $result = odbc_exec( $CONN, $sql ); for( $i = 1 ; $i <= odbc_num_fields( $result ) ; $i++ ) { $name = odbc_field_name( $result, $i ); ${$name} = odbc_result( $result, $name ); print( "$i: $name - ${$name}\n" ); } ?> Expected result: ---------------- 1: key - 4 2: a_really_long_name_that_is_longer_than_31_characters - 5 3: longer_name - 6 Actual result: -------------- 1: key - 4 2: a_really_long_name_that_is_long - 5 3: longer_name - 6 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30043&edit=1