#39023 [Opn]: problem with if when value = 0

From: Date: Tue, 03 Oct 2006 10:33:26 +0000
Subject: #39023 [Opn]: problem with if when value = 0
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-103028@lists.php.net to get a copy of this message
ID: 39023 User updated by: nicolas dot breuer at belcenter dot be Reported By: nicolas dot breuer at belcenter dot be Status: Open Bug Type: *General Issues Operating System: Linux PHP Version: 4.4.4 New Comment: some details to be clear : Expected result: ---------------- 0 0 0 Actual result: -------------- 0 0 0 0 Previous Comments: ------------------------------------------------------------------------ [2006-10-03 10:27:56] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39023&edit=1

« previous php.bugs (#103028) next »