#23990 [Bgs->Csd]: mssql_fetch_assoc does not support long column names
| From: | philip@php.net | Date: | Wed, 04 Jun 2003 00:44:30 +0000 |
| Subject: | #23990 [Bgs->Csd]: mssql_fetch_assoc does not support long column names | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969354242@lists.php.net to get a copy of this message | ||
ID: 23990
Updated by: philip@php.net
Reported By: php at electricsurfer dot com
-Status: Bogus
+Status: Closed
-Bug Type: MSSQL related
+Bug Type: Documentation problem
Operating System: Win XP PRO
PHP Version: 4.3.2
New Comment:
This is now documented and will show up when the manual is next built,
thanks for the report :)
http://cvs.php.net/cvs.php/phpdoc/en/reference/mssql/reference.xml
Previous Comments:
------------------------------------------------------------------------
[2003-06-03 18:48:06] fmk@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Functions returning a column name are based on the dbcolname() function
in DBLIB. DBLIB from microsoft was developed for SQL Server 6.x where
the max identifier length was 30
#define SQL_MAX_COLUMN_NAME_LEN 30
This is only a problem on Win32 where we use DBLIB from Microsoft. On
platforms where we use FreeTDS this is not a problem.
------------------------------------------------------------------------
[2003-06-03 16:42:24] php at electricsurfer dot com
Just found bug #20810 which coincides with this one.
mssql_fetch_field() also has the same problem.
------------------------------------------------------------------------
[2003-06-03 12:16:49] php at electricsurfer dot com
mssql_field_name() has same problem
------------------------------------------------------------------------
[2003-06-03 11:41:35] php at electricsurfer dot com
with mssql_fetch_assoc or mssql_fetch_array.
NOT mssql_fetch_row.
------------------------------------------------------------------------
[2003-06-03 11:29:50] php at electricsurfer dot com
If you select a field with a column name that has more than 30 chars.
Using mssql_fetch_assoc or mssql_fetch_row to fetch it will only return
a key with the 1st 30 chars.
( Mysql functions work with longer column names )
<?
// connect to db Here
$result = mssql_query('select MyVeryVeryVeryVeryVeryVeryLongColumnName
from table');
$row = mssql_fetch_assoc($result);
// $row = array('MyVeryVeryVeryVeryVeryVeryLong'=>50) (only first 30
chars in key)
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23990&edit=1