[PHP-DEV] PHP 4.0 Bug #9267 Updated: vars are set to "" instead of NULL From: phanto <email protected>
Date: 02/22/01

ID: 9267
User Update by: phanto <email protected>
Old-Status: Feedback
Status: Open
Bug Type: *Database Functions
Description: vars are set to "" instead of NULL

<?php
$db = mssql_connect("localhost", "xxx", "yyy");
mssql_select_db("zzz", $db);

$result = mssql_query("select NULL as test", $db);

mssql_fetch_row($result);
$blah = mssql_result($result, 0, "test");

$huh = NULL;

echo is_null($blah); // false
var_dump($blah); // bool(false)

echo is_null($huh); // true
var_dump($huh); // NULL
?>

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

[2001-02-22 05:26:38] stas <email protected>
Could you provide a short example of a code that reproduces
this?

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

[2001-02-14 17:06:49] phanto <email protected>
don't know if this is only related to the mssql extension, but when i retrieve a NULL - field from the database the var will be set to "" or 0 or whatever in php.

is_null() returns false.

harald.

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

Full Bug description available at: http://bugs.php.net/?id=9267

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>