ID: 9267
Updated by: jmoore
Old-Status: Open
Status: Closed
Old-Bug Type: *Database Functions
Bug Type: MySQL related
Assigned To: 

This seems due to PHP assuming MySQL's return values are strings, which point it is 
converted into an empty sting. Probably your best bet is to test for a "". I think 
this behaviour is documented somewhere.


Previous Comments:

[2001-02-22 13:30:58] [EMAIL PROTECTED]
$db = mssql_connect("localhost", "xxx", "yyy");
mssql_select_db("zzz", $db);

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

$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


[2001-02-22 05:26:38] [EMAIL PROTECTED]
Could you provide a short example of a code that reproduces


[2001-02-14 17:06:49] [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.



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to