ID:               29383
 Comment by:       dcrignon at adequasys dot com
 Reported By:      gunther at ultraconsulting dot com
 Status:           Open
 Bug Type:         MSSQL related
 Operating System: Windows 2000
 PHP Version:      4.3.7, 5.0.0
 New Comment:

I exaclty have the same problem!

In our intranet Php Solution, we can't upgrade from php 4.3.3 if we use
mssql database.

With Oracle or MySql, no problem, we can go to 4.3.9 or 5.0.

Now, a new element. On a customer installation, we need Apache 2.0.52
with SSL and in that case, PHP 4.3.3 is really unstable... So we need
to go to 4.3.8 or 4.3.9 but we can't, because of MSSQL bug with this
space returned instead of empty string !!!

Please PHP Team, any solution ???

Thanks,

David


Previous Comments:
------------------------------------------------------------------------

[2004-09-30 12:52:06] andreyra at chtivo dot ru

I have the same experience on version 4.3.8 - 4.3.9. Thank for advice
to use dll from version 4.3.2. It really solves a problem :).

------------------------------------------------------------------------

[2004-09-22 02:35:53] gunther at ultraconsulting dot com

It seems this problem is a long term problem as it was first reported a
year ago. Not quite sure why the developers are tagging these reports as
'Bogus'. Everybody using PHP 4.3.3 and higher and MSSQL is affected. The
problem is definetely in the php_mssql.dll as the version 4.3.2 dll is
working fine, even with PHP 4.3.8.
There is no way to upgrade to PHP 5.0.x as the functioning dll doesn't
work with 5.0.
Any clues if and when this bug will be fixed? 
Or at least a workaround for this bug without changing thousands of
lines of code withing the application.

------------------------------------------------------------------------

[2004-07-26 14:25:18] gunther at ultraconsulting dot com

This is the same as Bug #29292 .. didn't find that one before ...

------------------------------------------------------------------------

[2004-07-26 04:49:49] gunther at ultraconsulting dot com

php_mssql.dll up to PHP 4.3.3 is working fine, problem first started
with PHP 4.3.4

------------------------------------------------------------------------

[2004-07-26 03:46:00] gunther at ultraconsulting dot com

Description:
------------
A SELECT statement returns instead of an empty value for a varchar
field, a value containing a single space. Therefore using the empty()
directive will not work anymore.
Problem only happens with php_mssql.dll from year 2004 for PHP version
4.3.7 and 5.0.0. Using a previous dll from 3/13/03 (4.3.2-RC1) for
instance solves the problem ... but might cause others.


Reproduce code:
---------------
<?php
$db_host = 'localhost';
$db_user = 'sa';
$db_pass = '';

    if ($dbh = mssql_connect($db_host, $db_user, $db_pass)) {
                print ('<br><br>DB: "'.$db_name.'" connected');
        } else {
                print ("<br>DB NOK ");
                exit;
        } 


 $query = 'SELECT * FROM mydb WHERE id = 1';

  $result = mssql_query($query, $dbh);
  {
      if ($row = mssql_fetch_array($result, MSSQL_ASSOC)) {
          print_r($row);
          print("\n<br>(" . $row['id'] . ')');
      }
  }
?>

Expected result:
----------------
...
()

Actual result:
--------------
...
( )



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=29383&edit=1

Reply via email to