#40607 [NEW]: mssql_fetch_array concatinates spaces in middle of data
From: Joe at sofusion dot com Operating system: FREE BSD 6.0 PHP version: 5.2.1 PHP Bug Type: MSSQL related Bug description: mssql_fetch_array concatinates spaces in middle of data Description: When using mssql_fetch_arry and mssql_fetch_row, data returned that contains 2 spaces has been concatinated to one space. Example: Data returned should be "Two"' '' '"Spaces" (without quotes Two Spaces) But is returned as "Two"' '"Spaces" (without quotes -Two Spaces with one space between) FreeBSD WEBSERVER1.SOFUSION.local 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu Nov 3 09:36:13 UTC 2005 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC i386 Build Date Feb 22 2007 19:36:38 Configure Command './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--enable-versioning' '--with-mssql=/usr/local' '--enable-libxml' Library version FreeTDS Reproduce code: --- --MSSQL TABLE CREATE TABLE #T1( Name varchar(255), Number int ) INSERT INTO #T1 VALUES('Two Spaces',1) INSERT INTO #T1 VALUES('One Spaces',2) --PHP CODE $sql = "select Name FROM Name_TBL WHERE Number = '1'"; $rs = mssql_query($sql); $RT = mssql_fetch_array($rs); $Name= $RT[Name']; --This should have 2 spaces in it like the DB --But it only has one echo $Name Expected result: Two Spaces --This has 2 spaces between the words. Actual result: -- Two Spaces --This only hase 1 space between the words -- Edit bug report at http://bugs.php.net/?id=40607&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40607&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40607&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40607&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40607&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40607&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40607&r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=40607&r=needscript Try newer version:http://bugs.php.net/fix.php?id=40607&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40607&r=support Expected behavior:http://bugs.php.net/fix.php?id=40607&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40607&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40607&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40607&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40607&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40607&r=dst IIS Stability:http://bugs.php.net/fix.php?id=40607&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40607&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40607&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40607&r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=40607&r=mysqlcfg
#40607 [Opn]: mssql_fetch_array concatinates spaces in middle of data
ID: 40607 User updated by: Joe at sofusion dot com Reported By: Joe at sofusion dot com Status: Open Bug Type: MSSQL related Operating System: FREE BSD 6.0 PHP Version: 5.2.1 New Comment: Sorry, dont use # in TBL Name. USE THIS DB CODE AND PHP CODE TO TEST: CREATE TABLE T1( Name varchar(255), Number int ) INSERT INTO T1 VALUES('Two Spaces',1) INSERT INTO T1 VALUES('One Spaces',2) $sql = "SELECT Name FROM T1 WHERE Number = '1'"; $rs = mssql_query($sql); while ($RT = mssql_fetch_array($rs)) {$Name= $RT['Name']; //This should have 2 spaces in it like the DB //But it only has one echo ' Name = '.$Name . ''; } Previous Comments: -------------------- [2007-02-23 15:59:40] Joe at sofusion dot com Description: When using mssql_fetch_arry and mssql_fetch_row, data returned that contains 2 spaces has been concatinated to one space. Example: Data returned should be "Two"' '' '"Spaces" (without quotes Two Spaces) But is returned as "Two"' '"Spaces" (without quotes -Two Spaces with one space between) FreeBSD WEBSERVER1.SOFUSION.local 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu Nov 3 09:36:13 UTC 2005 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC i386 Build Date Feb 22 2007 19:36:38 Configure Command './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--enable-versioning' '--with-mssql=/usr/local' '--enable-libxml' Library version FreeTDS Reproduce code: --- --MSSQL TABLE CREATE TABLE #T1( Name varchar(255), Number int ) INSERT INTO #T1 VALUES('Two Spaces',1) INSERT INTO #T1 VALUES('One Spaces',2) --PHP CODE $sql = "select Name FROM Name_TBL WHERE Number = '1'"; $rs = mssql_query($sql); $RT = mssql_fetch_array($rs); $Name= $RT[Name']; --This should have 2 spaces in it like the DB --But it only has one echo $Name Expected result: Two Spaces --This has 2 spaces between the words. Actual result: -- Two Spaces --This only hase 1 space between the words -- Edit this bug report at http://bugs.php.net/?id=40607&edit=1
#40607 [Bgs]: mssql_fetch_array concatinates spaces in middle of data
ID: 40607 User updated by: Joe at sofusion dot com Reported By: Joe at sofusion dot com Status: Bogus Bug Type: MSSQL related Operating System: FREE BSD 6.0 PHP Version: 5.2.1 New Comment: When I use the tags, It does display the correct data. Is this telling me that it is HTML that is concatinating the 2 spaces into one? Also you can use: $Name = str_replace (' ', ':', $RT['Name']); echo ' Name2 = '.$Name . ''; to see the 2 spaces. When you duplicate the bug, do you have 2 spaces between the words in your browser? Thanks!! Previous Comments: [2007-02-23 19:29:07] [EMAIL PROTECTED] I'm unable to reproduce this (on Linux and WIndows with FreeTDS). Try viewing the result outside the browser, use or get the length of the column to verify that you are getting the right results. ---------------- [2007-02-23 16:18:14] Joe at sofusion dot com Sorry, dont use # in TBL Name. USE THIS DB CODE AND PHP CODE TO TEST: CREATE TABLE T1( Name varchar(255), Number int ) INSERT INTO T1 VALUES('Two Spaces',1) INSERT INTO T1 VALUES('One Spaces',2) $sql = "SELECT Name FROM T1 WHERE Number = '1'"; $rs = mssql_query($sql); while ($RT = mssql_fetch_array($rs)) {$Name= $RT['Name']; //This should have 2 spaces in it like the DB //But it only has one echo ' Name = '.$Name . ''; } [2007-02-23 15:59:40] Joe at sofusion dot com Description: When using mssql_fetch_arry and mssql_fetch_row, data returned that contains 2 spaces has been concatinated to one space. Example: Data returned should be "Two"' '' '"Spaces" (without quotes Two Spaces) But is returned as "Two"' '"Spaces" (without quotes -Two Spaces with one space between) FreeBSD WEBSERVER1.SOFUSION.local 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu Nov 3 09:36:13 UTC 2005 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC i386 Build Date Feb 22 2007 19:36:38 Configure Command './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--enable-versioning' '--with-mssql=/usr/local' '--enable-libxml' Library version FreeTDS Reproduce code: --- --MSSQL TABLE CREATE TABLE #T1( Name varchar(255), Number int ) INSERT INTO #T1 VALUES('Two Spaces',1) INSERT INTO #T1 VALUES('One Spaces',2) --PHP CODE $sql = "select Name FROM Name_TBL WHERE Number = '1'"; $rs = mssql_query($sql); $RT = mssql_fetch_array($rs); $Name= $RT[Name']; --This should have 2 spaces in it like the DB --But it only has one echo $Name Expected result: Two Spaces --This has 2 spaces between the words. Actual result: -- Two Spaces --This only hase 1 space between the words -- Edit this bug report at http://bugs.php.net/?id=40607&edit=1
#40607 [Bgs->Csd]: mssql_fetch_array concatinates spaces in middle of data
ID: 40607 User updated by: Joe at sofusion dot com Reported By: Joe at sofusion dot com -Status: Bogus +Status: Closed Bug Type: MSSQL related Operating System: FREE BSD 6.0 PHP Version: 5.2.1 New Comment: Thanks!! Previous Comments: [2007-02-23 20:40:48] [EMAIL PROTECTED] This is a normal browser feature. The browser will reduce the whitespace (spaces, tabs new lines etc) to a single space. You could replace each space with if you want to force two spaces. [2007-02-23 20:16:24] Joe at sofusion dot com When I use the tags, It does display the correct data. Is this telling me that it is HTML that is concatinating the 2 spaces into one? Also you can use: $Name = str_replace (' ', ':', $RT['Name']); echo ' Name2 = '.$Name . ''; to see the 2 spaces. When you duplicate the bug, do you have 2 spaces between the words in your browser? Thanks!! [2007-02-23 19:29:07] [EMAIL PROTECTED] I'm unable to reproduce this (on Linux and WIndows with FreeTDS). Try viewing the result outside the browser, use or get the length of the column to verify that you are getting the right results. ---------------- [2007-02-23 16:18:14] Joe at sofusion dot com Sorry, dont use # in TBL Name. USE THIS DB CODE AND PHP CODE TO TEST: CREATE TABLE T1( Name varchar(255), Number int ) INSERT INTO T1 VALUES('Two Spaces',1) INSERT INTO T1 VALUES('One Spaces',2) $sql = "SELECT Name FROM T1 WHERE Number = '1'"; $rs = mssql_query($sql); while ($RT = mssql_fetch_array($rs)) {$Name= $RT['Name']; //This should have 2 spaces in it like the DB //But it only has one echo ' Name = '.$Name . ''; } [2007-02-23 15:59:40] Joe at sofusion dot com Description: When using mssql_fetch_arry and mssql_fetch_row, data returned that contains 2 spaces has been concatinated to one space. Example: Data returned should be "Two"' '' '"Spaces" (without quotes Two Spaces) But is returned as "Two"' '"Spaces" (without quotes -Two Spaces with one space between) FreeBSD WEBSERVER1.SOFUSION.local 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu Nov 3 09:36:13 UTC 2005 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC i386 Build Date Feb 22 2007 19:36:38 Configure Command './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--enable-versioning' '--with-mssql=/usr/local' '--enable-libxml' Library version FreeTDS Reproduce code: --- --MSSQL TABLE CREATE TABLE #T1( Name varchar(255), Number int ) INSERT INTO #T1 VALUES('Two Spaces',1) INSERT INTO #T1 VALUES('One Spaces',2) --PHP CODE $sql = "select Name FROM Name_TBL WHERE Number = '1'"; $rs = mssql_query($sql); $RT = mssql_fetch_array($rs); $Name= $RT[Name']; --This should have 2 spaces in it like the DB --But it only has one echo $Name Expected result: Two Spaces --This has 2 spaces between the words. Actual result: -- Two Spaces --This only hase 1 space between the words -- Edit this bug report at http://bugs.php.net/?id=40607&edit=1