php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39023 problem with if when value = 0
Submitted: 2006-10-03 10:27 UTC Modified: 2006-10-03 15:12 UTC
From: nicolas dot breuer at belcenter dot be Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.4.4 OS: Linux
Private report: No CVE-ID: None
 [2006-10-03 10:27 UTC] nicolas dot breuer at belcenter dot be
Description:
------------
 When i retrieve a value from a mysql db, 
 value returned is nothing or "0" , "if" command
 is not executed as well.

 

Reproduce code:
---------------
// in a while process
 $value="";
 $reqt = mysql_query("select value from table where  ref='$xxx'");
 $value = mysql_result($reqt,0,"value");

 if ($value=="0"){
 echo "$value"; }
 

Expected result:
----------------
 each echo value should be "0"

Actual result:
--------------
 i have some results with $value = nothing.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-03 10:33 UTC] nicolas dot breuer at belcenter dot be
some details to be clear : 

 Expected result:
----------------
0
0
0

Actual result:
--------------
0

0
0

0
 [2006-10-03 15:12 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 13:00:01 2026 UTC