#40986 [Bgs->Opn]: mssql_field_name() retrieves only first 30 characters

From: Date: Wed, 11 Apr 2007 08:44:12 +0000
Subject: #40986 [Bgs->Opn]: mssql_field_name() retrieves only first 30 characters
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-111328@lists.php.net to get a copy of this message
ID: 40986 User updated by: Arne dot Heizmann at csr dot com Reported By: Arne dot Heizmann at csr dot com -Status: Bogus +Status: Open Bug Type: MSSQL related Operating System: Windows 2000 PHP Version: 5.2.1 New Comment: (reopening, see above comment) Previous Comments: ------------------------------------------------------------------------ [2007-04-11 08:42:16] Arne dot Heizmann at csr dot com If using another DLL solves the problem, then clearly the mssql_*() functions should use it and not something buggy. If this problem is known, why is PHP still shipped with it? ------------------------------------------------------------------------ [2007-04-03 22:08:43] fmk@php.net This is a limit in the MSSQL library (ntwdblib.dll) used to build the extension. Use the php_dblib.dll version of the extension. This version is build with FreeTDS and does not have these limitations. This has been reported many times before. Please search the archives before posting the same bugs over and over. ------------------------------------------------------------------------ [2007-04-03 17:43:05] Arne dot Heizmann at csr dot com Description: ------------ The function mssql_field_name() appears to return only the first 30 characters of the field name. Reproduce code: --------------- <? $sql = 'select 1 as [This is a field name that is longer than 30 characters]'; $mssqlh = mssql_pconnect ('server', 'username', 'password'); // change as appropriate mssql_select_db ('databasename', $mssqlh); // change as appropriate $result = mssql_query ($sql, $mssqlh); $fieldname = mssql_field_name ($result, 0); var_export ($fieldname); ?> Expected result: ---------------- 'This is a field name that is longer than 30 characters' Actual result: -------------- 'This is a field name that is l' ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40986&edit=1

« previous php.bugs (#111328) next »