[PHP-DEV] PHP 4.0 Bug #9267 Updated: vars are set to "" instead of NULL

2001-02-25 Thread phanto

ID: 9267
User Update by: [EMAIL PROTECTED]
Status: Closed
Old-Bug Type: MySQL related
Bug Type: Feature/Change Request
Description: vars are set to "" instead of NULL

i think this is not an acceptable behaviour. "" could be everything, an empty string, 
an integer field with the value null or even a field set to NULL.
as you obviously noticed we are talking from database interfaces in general, not only 
mysql (as you can see we where talking about mssql in detail).

at least i would make this a feature request.

Previous Comments:
---

[2001-02-24 12:14:05] [EMAIL PROTECTED]
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.

James

---

[2001-02-22 13:30:58] [EMAIL PROTECTED]




---

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

---

[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.

harald.

---


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


-- 
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]




RE: [PHP-DEV] PHP 4.0 Bug #9267 Updated: vars are set to "" instead of NULL

2001-02-24 Thread James Moore


> 1) not mysql, mssql
> 
> 2.  it means that the mssql_result call failed for some reason, because
> false was returned, not an empty string.
> 
> still, the bug should be closed ;-)

*Cough* I should really get some glasses ;) *cough*

James

-- 
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]




Re: [PHP-DEV] PHP 4.0 Bug #9267 Updated: vars are set to "" instead of NULL

2001-02-24 Thread Sterling Hughes

> ID: 9267
> Updated by: jmoore
> Reported By: [EMAIL PROTECTED]
> Old-Status: Open
> Status: Closed
> Old-Bug Type: *Database Functions
> Bug Type: MySQL related
> Assigned To:
> Comments:
>
> 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.
>
> James
>

1) not mysql, mssql

2.  it means that the mssql_result call failed for some reason, because
false was returned, not an empty string.

still, the bug should be closed ;-)

-Sterling


> 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);
>
> 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
> ?>
>
>
>
> --
-
>
> [2001-02-22 05:26:38] [EMAIL PROTECTED]
> Could you provide a short example of a code that reproduces
> this?
>
> --
-
>
> [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.
>
> harald.
>
> --
-
>
>
>
> ATTENTION! Do NOT reply to this email!
> To reply, use the web interface found at
http://bugs.php.net/?id=9267&edit=2
>
>
> --
> 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]
>


-- 
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]




[PHP-DEV] PHP 4.0 Bug #9267 Updated: vars are set to "" instead of NULL

2001-02-24 Thread jmoore

ID: 9267
Updated by: jmoore
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Closed
Old-Bug Type: *Database Functions
Bug Type: MySQL related
Assigned To: 
Comments:

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.

James

Previous Comments:
---

[2001-02-22 13:30:58] [EMAIL PROTECTED]




---

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

---

[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.

harald.

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9267&edit=2


-- 
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]




[PHP-DEV] PHP 4.0 Bug #9267 Updated: vars are set to "" instead of NULL

2001-02-22 Thread phanto

ID: 9267
User Update by: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Open
Bug Type: *Database Functions
Description: vars are set to "" instead of NULL





Previous Comments:
---

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

---

[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.

harald.

---


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


-- 
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]




[PHP-DEV] PHP 4.0 Bug #9267 Updated: vars are set to "" instead of NULL

2001-02-22 Thread stas

ID: 9267
Updated by: stas
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Feedback
Bug Type: *Database Functions
Assigned To: 
Comments:

Could you provide a short example of a code that reproduces
this?

Previous Comments:
---

[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.

harald.

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9267&edit=2


-- 
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]