php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63574 mssql_field_name => filed truncated to 30 chars
Submitted: 2012-11-21 16:32 UTC Modified: 2016-10-15 23:17 UTC
From: aurelien dot lequoy at gmail dot com Assigned:
Status: Wont fix Package: MSSQL related
PHP Version: 5.3.18 OS: Linux / Debian 6.01
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: aurelien dot lequoy at gmail dot com
New email:
PHP Version: OS:

 

 [2012-11-21 16:32 UTC] aurelien dot lequoy at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.mssql-field-name#refsect1-
function.mssql-field-name-seealso
---


Still only returns 1st 30 characters of fieldname, I thought this issue was 
fixed.


solution ? : (quick fix)

SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME='ARKA_PIV_BIZFILE_FULL' order by ORDINAL_POSITION



Test script:
---------------
set a filed name > 30 chars, make a query and use mssql_field_name to get the field name


CREATE TABLE dbo.[ARKA_PIV_BIZFILE_FULL]
	(
LegacySystem nvarchar(10) null,
Subsidiary nvarchar(25) null,
LogoName nvarchar(150) null,
AccountRef nvarchar(25) null,
Account_name nvarchar(150) null,
AccountCreationDate nvarchar(100) null,
[Customer TimeZone] nvarchar(100) null,
Currency nvarchar(10) null,
LastYear_Revenue nvarchar(10) null,
Current_Revenue nvarchar(10) null,
NbAccess nvarchar(10) null,
Is_prospect nvarchar(10) null,
AccountStatus nvarchar(10) null,
BizFileStatus nvarchar(10) null,
Comment nvarchar(10) null,
RecordCreationDate nvarchar(20) null,
RecordLastModificationDate nvarchar(20) null,
RecordLastModifierUserLogin nvarchar(10) null,
Line_in_error nvarchar(10) null,
Line_error_comment nvarchar(10) null,
Subscription_start_date nvarchar(20) null,
Subscription_end_date nvarchar(20) null,
Subscribed_offer_name nvarchar(10) null,
isCloud nvarchar(10) null,
Event nvarchar(25) null,
Anytime nvarchar(10) null,
Anywhere nvarchar(10) null,
WebEx nvarchar(25) null,
WebCast nvarchar(10) null,
isVidyo nvarchar(10) null,
GlobalCommitmentAmount nvarchar(10) null,
GlobalCommitmentPeriod nvarchar(10) null,
OtherFlatRecurringCharge nvarchar(10) null,
Anywhere_NH_nbr_of_Licenses nvarchar(10) null,
Anywhere_NH_Per_License_Price nvarchar(10) null,
AnyWhere_NH_PriceType nvarchar(10) null,
AnyWhere_NH_Threshold_Min nvarchar(10) null,
AnyWhere_NH_Threshold_Max nvarchar(10) null,
AnyWhere_NH_RoomSize nvarchar(10) null,
AnyWhere_OverageType nvarchar(10) null,
AnyWhere_Overage_Price nvarchar(10) null,
WebEx_MeetingCenter nvarchar(10) null,
WebEx_EventCenter nvarchar(10) null,
WebEx_SupportCenter nvarchar(10) null,
WebEx_TrainingCenter nvarchar(10) null,
WebEx_MicroSite nvarchar(10) null,
WebEx_Admin_Login nvarchar(10) null,
WebEx_Admin_PWD nvarchar(10) null,
Webex_NH_nbr_of_Licenses nvarchar(10) null,
WebEx_NH_PriceType nvarchar(10) null,
Webex_NH_Per_License_Price nvarchar(10) null,
Webex_NH_Per_License_Threshold_Min nvarchar(10) null,
Webex_NH_Per_License_Threshold_Max nvarchar(10) null,
WebEx_CP_nbr_of_Licenses nvarchar(10) null,
WebEx_CP_PriceType nvarchar(10) null,
WebEx_CP_License_Price nvarchar(10) null,
WebEx_CP_Threshold_Min nvarchar(10) null,
WebEx_CP_Threshold_Max nvarchar(10) null,
WebEx_RoomSize nvarchar(10) null,
WebEx_Overage_Type nvarchar(10) null,
WebEx_Overage_Price nvarchar(10) null,
BandDiscount1_BandName nvarchar(10) null,
BandDiscount1_MinuteThreshold_Min_1 nvarchar(10) null,
BandDiscount1_MinuteThreshold_Max_1 nvarchar(10) null,
BandDiscount1_DiscountPercentage_1 nvarchar(10) null,
BandDiscount1_MinuteThreshold_Min_2 nvarchar(10) null,
BandDiscount1_MinuteThreshold_Max_2 nvarchar(10) null,
BandDiscount1_DiscountPercentage_2 nvarchar(10) null,
BandDiscount1_MinuteThreshold_Min_3 nvarchar(10) null,
BandDiscount1_MinuteThreshold_Max_3 nvarchar(10) null,
BandDiscount1_DiscountPercentage_3 nvarchar(10) null,
BandDiscount2_BandName nvarchar(10) null,
BandDiscount2_MinuteThreshold_Min_1 nvarchar(10) null,
BandDiscount2_MinuteThreshold_Max_1 nvarchar(10) null,
BandDiscount2_DiscountPercentage_1 nvarchar(10) null,
BandDiscount2_MinuteThreshold_Min_2 nvarchar(10) null,
BandDiscount2_MinuteThreshold_Max_2 nvarchar(10) null,
BandDiscount2_DiscountPercentage_2 nvarchar(10) null,
BandDiscount2_MinuteThreshold_Min_3 nvarchar(10) null,
BandDiscount2_MinuteThreshold_Max_3 nvarchar(10) null,
BandDiscount2_DiscountPercentage_3 nvarchar(10) null,
VolumeDiscount_Threshold_Metric nvarchar(10) null,
VolumeDiscount_Threshold_Min_1 nvarchar(10) null,
VolumeDiscount_Threshold_Max_1 nvarchar(10) null,
VolumeDiscount_DiscountPercentage_1 nvarchar(10) null,
VolumeDiscount_Threshold_Min_2 nvarchar(10) null,
VolumeDiscount_Threshold_Max_2 nvarchar(10) null,
VolumeDiscount_DiscountPercentage_2 nvarchar(10) null,
VolumeDiscount_Threshold_Min_3 nvarchar(10) null,
VolumeDiscount_Threshold_Max_3 nvarchar(10) null,
VolumeDiscount_DiscountPercentage_3 nvarchar(10) null,
VolumeDiscount_Threshold_Min_4 nvarchar(10) null,
VolumeDiscount_Threshold_Max_4 nvarchar(10) null,
VolumeDiscount_DiscountPercentage_4 nvarchar(10) null,
Is_FlatDiscount_with_condition nvarchar(10) null,
Flat_Discount_condition nvarchar(10) null,
Flat_Discount_Threshold  nvarchar(10) null,
Flat_discountAmount nvarchar(10) null,
EventId nvarchar(10) null,
EventStatus nvarchar(10) null,
Event_ExpectedEventStartDate nvarchar(20) null,
Event_ExpectedEventEndDate nvarchar(20) null,
Event_ExpectedDuration nvarchar(10) null,
Event_ScheduledNumberOfAttendees nvarchar(10) null,
Event_EffectiveNumberOfAttendees nvarchar(10) null,
Event_SetupRate nvarchar(10) null,
Event_minimumFee nvarchar(10) null,
Event_CancellationRate_24H nvarchar(10) null,
Event_CancellationRate_48H nvarchar(10) null,
Event_CancellationRate_NoShow nvarchar(10) null,
PEvent_basic_price nvarchar(10) null,
PEvent_included_minutes nvarchar(10) null,
PEvent_blockSizeOfAdditionalMinutes nvarchar(10) null,
PEvent_pricePerAdditionalBlockOfMinutes nvarchar(10) null,
BT_Salutation nvarchar(20) null,
BT_Name1 nvarchar(200) null,
BT_Name2 nvarchar(200) null,
BT_FirstName nvarchar(200) null,
BT_MiddleInitial nvarchar(10) null,
BT_LastName nvarchar(200) null,
BT_Email nvarchar(200) null,
BT_Address1 nvarchar(200) null,
BT_Address2 nvarchar(200) null,
BT_Address3 nvarchar(200) null,
BT_City nvarchar(200) null,
BT_State nvarchar(200) null,
BT_Zip nvarchar(50) null,
BT_Country nvarchar(50) null,
BT_LocalSalutation nvarchar(20) null,
BT_LocalFirstName nvarchar(200) null,
BT_LocalMiddleInitial nvarchar(20) null,
BT_LocalLastName nvarchar(200) null,
BT_LocalAddress1 nvarchar(200) null,
BT_LocalAddress2 nvarchar(200) null,
BT_LocalAddress3 nvarchar(200) null,
BT_LocalCity nvarchar(200) null,
BT_LocalState nvarchar(200) null,
ST_Salutation nvarchar(20) null,
ST_Name1 nvarchar(200) null,
ST_Name2 nvarchar(200) null,
ST_FirstName nvarchar(200) null,
ST_MiddleInitial nvarchar(10) null,
ST_LastName nvarchar(200) null,
ST_Email nvarchar(200)null ,
ST_Address1 nvarchar(200) null,
ST_Address2 nvarchar(200) null,
ST_Address3 nvarchar(200) null,
ST_City nvarchar(200) null,
ST_State nvarchar(200) null,
ST_Zip nvarchar(50) null,
ST_Country nvarchar(50) null,
ST_LocalSalutation nvarchar(20) null,
ST_LocalFirstName nvarchar(200) null,
ST_LocalMiddleInitial nvarchar(20) null,
ST_LocalLastName nvarchar(200) null,
ST_LocalAddress1 nvarchar(200) null,
ST_LocalAddress2 nvarchar(200) null,
ST_LocalAddress3 nvarchar(200) null,
ST_LocalCity nvarchar(200) null,
ST_LocalState nvarchar(200) null,
BT_County nvarchar(50) null,
BT_LocalCounty nvarchar(50) null,
ST_County nvarchar(50) null,
ST_LocalCounty nvarchar(50) null
	)  ON [PRIMARY]
go

Expected result:
----------------
LegacySystem
Subsidiary
LogoName
AccountRef
Account_name
AccountCreationDate
Customer TimeZone
Currency
LastYear_Revenue
Current_Revenue
NbAccess
Is_prospect
AccountStatus
BizFileStatus
Comment
RecordCreationDate
RecordLastModificationDate
RecordLastModifierUserLogin
Line_in_error
Line_error_comment
Subscription_start_date
Subscription_end_date
Subscribed_offer_name
isCloud
Event
Anytime
Anywhere
WebEx
WebCast
isVidyo
GlobalCommitmentAmount
GlobalCommitmentPeriod
OtherFlatRecurringCharge
Anywhere_NH_nbr_of_Licenses
Anywhere_NH_Per_License_Price
AnyWhere_NH_PriceType
AnyWhere_NH_Threshold_Min
AnyWhere_NH_Threshold_Max
AnyWhere_NH_RoomSize
AnyWhere_OverageType
AnyWhere_Overage_Price
WebEx_MeetingCenter
WebEx_EventCenter
WebEx_SupportCenter
WebEx_TrainingCenter
WebEx_MicroSite
WebEx_Admin_Login
WebEx_Admin_PWD
Webex_NH_nbr_of_Licenses
WebEx_NH_PriceType
Webex_NH_Per_License_Price
Webex_NH_Per_License_Threshold_Min
Webex_NH_Per_License_Threshold_Max
WebEx_CP_nbr_of_Licenses
WebEx_CP_PriceType
WebEx_CP_License_Price
WebEx_CP_Threshold_Min
WebEx_CP_Threshold_Max
WebEx_RoomSize
WebEx_Overage_Type
WebEx_Overage_Price
BandDiscount1_BandName
BandDiscount1_MinuteThreshold_Min_1
BandDiscount1_MinuteThreshold_Max_1
BandDiscount1_DiscountPercentage_1
BandDiscount1_MinuteThreshold_Min_2
BandDiscount1_MinuteThreshold_Max_2
BandDiscount1_DiscountPercentage_2
BandDiscount1_MinuteThreshold_Min_3
BandDiscount1_MinuteThreshold_Max_3
BandDiscount1_DiscountPercentage_3
BandDiscount2_BandName
BandDiscount2_MinuteThreshold_Min_1
BandDiscount2_MinuteThreshold_Max_1
BandDiscount2_DiscountPercentage_1
BandDiscount2_MinuteThreshold_Min_2
BandDiscount2_MinuteThreshold_Max_2
BandDiscount2_DiscountPercentage_2
BandDiscount2_MinuteThreshold_Min_3
BandDiscount2_MinuteThreshold_Max_3
BandDiscount2_DiscountPercentage_3
VolumeDiscount_Threshold_Metric
VolumeDiscount_Threshold_Min_1
VolumeDiscount_Threshold_Max_1
VolumeDiscount_DiscountPercentage_1
VolumeDiscount_Threshold_Min_2
VolumeDiscount_Threshold_Max_2
VolumeDiscount_DiscountPercentage_2
VolumeDiscount_Threshold_Min_3
VolumeDiscount_Threshold_Max_3
VolumeDiscount_DiscountPercentage_3
VolumeDiscount_Threshold_Min_4
VolumeDiscount_Threshold_Max_4
VolumeDiscount_DiscountPercentage_4
Is_FlatDiscount_with_condition
Flat_Discount_condition
Flat_Discount_Threshold
Flat_discountAmount
EventId
EventStatus
Event_ExpectedEventStartDate
Event_ExpectedEventEndDate
Event_ExpectedDuration
Event_ScheduledNumberOfAttendees
Event_EffectiveNumberOfAttendees
Event_SetupRate
Event_minimumFee
Event_CancellationRate_24H
Event_CancellationRate_48H
Event_CancellationRate_NoShow
PEvent_basic_price
PEvent_included_minutes
PEvent_blockSizeOfAdditionalMinutes
PEvent_pricePerAdditionalBlockOfMinutes
BT_Salutation
BT_Name1
BT_Name2
BT_FirstName
BT_MiddleInitial
BT_LastName
BT_Email
BT_Address1
BT_Address2
BT_Address3
BT_City
BT_State
BT_Zip
BT_Country
BT_LocalSalutation
BT_LocalFirstName
BT_LocalMiddleInitial
BT_LocalLastName
BT_LocalAddress1
BT_LocalAddress2
BT_LocalAddress3
BT_LocalCity
BT_LocalState
ST_Salutation
ST_Name1
ST_Name2
ST_FirstName
ST_MiddleInitial
ST_LastName
ST_Email
ST_Address1
ST_Address2
ST_Address3
ST_City
ST_State
ST_Zip
ST_Country
ST_LocalSalutation
ST_LocalFirstName
ST_LocalMiddleInitial
ST_LocalLastName
ST_LocalAddress1
ST_LocalAddress2
ST_LocalAddress3
ST_LocalCity
ST_LocalState
BT_County
BT_LocalCounty
ST_County
ST_LocalCounty

Actual result:
--------------
LegacySystem
Subsidiary
LogoName
AccountRef
Account_name
AccountCreationDate
Customer TimeZone
Currency
LastYear_Revenue
Current_Revenue
NbAccess
Is_prospect
AccountStatus
BizFileStatus
Comment
RecordCreationDate
RecordLastModificationDate
RecordLastModifierUserLogin
Line_in_error
Line_error_comment
Subscription_start_date
Subscription_end_date
Subscribed_offer_name
isCloud
Event
Anytime
Anywhere
WebEx
WebCast
isVidyo
GlobalCommitmentAmount
GlobalCommitmentPeriod
OtherFlatRecurringCharge
Anywhere_NH_nbr_of_Licenses
Anywhere_NH_Per_License_Price
AnyWhere_NH_PriceType
AnyWhere_NH_Threshold_Min
AnyWhere_NH_Threshold_Max
AnyWhere_NH_RoomSize
AnyWhere_OverageType
AnyWhere_Overage_Price
WebEx_MeetingCenter
WebEx_EventCenter
WebEx_SupportCenter
WebEx_TrainingCenter
WebEx_MicroSite
WebEx_Admin_Login
WebEx_Admin_PWD
Webex_NH_nbr_of_Licenses
WebEx_NH_PriceType
Webex_NH_Per_License_Price
Webex_NH_Per_License_Threshold
Webex_NH_Per_License_Threshold
WebEx_CP_nbr_of_Licenses
WebEx_CP_PriceType
WebEx_CP_License_Price
WebEx_CP_Threshold_Min
WebEx_CP_Threshold_Max
WebEx_RoomSize
WebEx_Overage_Type
WebEx_Overage_Price
BandDiscount1_BandName
BandDiscount1_MinuteThreshold_
BandDiscount1_MinuteThreshold_
BandDiscount1_DiscountPercenta
BandDiscount1_MinuteThreshold_
BandDiscount1_MinuteThreshold_
BandDiscount1_DiscountPercenta
BandDiscount1_MinuteThreshold_
BandDiscount1_MinuteThreshold_
BandDiscount1_DiscountPercenta
BandDiscount2_BandName
BandDiscount2_MinuteThreshold_
BandDiscount2_MinuteThreshold_
BandDiscount2_DiscountPercenta
BandDiscount2_MinuteThreshold_
BandDiscount2_MinuteThreshold_
BandDiscount2_DiscountPercenta
BandDiscount2_MinuteThreshold_
BandDiscount2_MinuteThreshold_
BandDiscount2_DiscountPercenta
VolumeDiscount_Threshold_Metri
VolumeDiscount_Threshold_Min_1
VolumeDiscount_Threshold_Max_1
VolumeDiscount_DiscountPercent
VolumeDiscount_Threshold_Min_2
VolumeDiscount_Threshold_Max_2
VolumeDiscount_DiscountPercent
VolumeDiscount_Threshold_Min_3
VolumeDiscount_Threshold_Max_3
VolumeDiscount_DiscountPercent
VolumeDiscount_Threshold_Min_4
VolumeDiscount_Threshold_Max_4
VolumeDiscount_DiscountPercent
Is_FlatDiscount_with_condition
Flat_Discount_condition
Flat_Discount_Threshold
Flat_discountAmount
EventId
EventStatus
Event_ExpectedEventStartDate
Event_ExpectedEventEndDate
Event_ExpectedDuration
Event_ScheduledNumberOfAttende
Event_EffectiveNumberOfAttende
Event_SetupRate
Event_minimumFee
Event_CancellationRate_24H
Event_CancellationRate_48H
Event_CancellationRate_NoShow
PEvent_basic_price
PEvent_included_minutes
PEvent_blockSizeOfAdditionalMi
PEvent_pricePerAdditionalBlock
BT_Salutation
BT_Name1
BT_Name2
BT_FirstName
BT_MiddleInitial
BT_LastName
BT_Email
BT_Address1
BT_Address2
BT_Address3
BT_City
BT_State
BT_Zip
BT_Country
BT_LocalSalutation
BT_LocalFirstName
BT_LocalMiddleInitial
BT_LocalLastName
BT_LocalAddress1
BT_LocalAddress2
BT_LocalAddress3
BT_LocalCity
BT_LocalState
ST_Salutation
ST_Name1
ST_Name2
ST_FirstName
ST_MiddleInitial
ST_LastName
ST_Email
ST_Address1
ST_Address2
ST_Address3
ST_City
ST_State
ST_Zip
ST_Country
ST_LocalSalutation
ST_LocalFirstName
ST_LocalMiddleInitial
ST_LocalLastName
ST_LocalAddress1
ST_LocalAddress2
ST_LocalAddress3
ST_LocalCity
ST_LocalState
BT_County
BT_LocalCounty
ST_County
ST_LocalCounty

Patches

quick-fix (last revision 2012-11-21 16:35 UTC by aurelien dot lequoy at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-10-15 23:17 UTC] kalle@php.net
-Status: Open +Status: Wont fix
 [2016-10-15 23:17 UTC] kalle@php.net
With MSSQL being removed from PHP as of PHP7.0, and ext/mssql not having a maintainer, I'm gonna close this report as a Won't fix, until maybe one day it will find a new maintainer.

Alternatively you can use sqlsrv from Microsoft if you are on Windows, or pdo_dblib if you are on Unix.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Nov 23 19:01:26 2020 UTC