ID: 29383 User updated by: gunther at ultraconsulting dot com Reported By: gunther at ultraconsulting dot com Status: Open Bug Type: MSSQL related -Operating System: w2k +Operating System: Windows 2000 -PHP Version: 4.3.7 +PHP Version: 4.3.7, 5.0.0 New Comment:
This is the same as Bug #29292 .. didn't find that one before ... Previous Comments: ------------------------------------------------------------------------ [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