Jangga
Junior Member
- Aug 8, 2016
- 196
- 11
$bonusreg = "SELECT * FROM money WHERE username='$user'";
$bons = mysql_query($bonusreg) or die(mysql_error());
$dayzzee = $bons["bonus"];
if($dayzzee==0 && $duration=30){
My code here
}
Dayzzee & duration are numbers from my db. The problem I'm having is this. Please go through them.
1. If I use if($dayzzee==0 && $duration==30) it works but it always evaluate to TRUE if duration is 30 even when dayzzee is more than 0
2. If I use if($dayzzee='0' && $duration='30') it doesn't work at all
3. If I use if(!($dayzzee>0) && $duration=30) it is same as 1 above
Pls, I'm confused
$bons = mysql_query($bonusreg) or die(mysql_error());
$dayzzee = $bons["bonus"];
if($dayzzee==0 && $duration=30){
My code here
}
Dayzzee & duration are numbers from my db. The problem I'm having is this. Please go through them.
1. If I use if($dayzzee==0 && $duration==30) it works but it always evaluate to TRUE if duration is 30 even when dayzzee is more than 0
2. If I use if($dayzzee='0' && $duration='30') it doesn't work at all
3. If I use if(!($dayzzee>0) && $duration=30) it is same as 1 above
Pls, I'm confused
Last edited: