Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if condition problem!! pls help

Status
Not open for further replies.

Forri

Programmer
Joined
Oct 29, 2003
Messages
479
Location
MT
Hi all

I have the following condition:

Code:
if ($AVE_LEAVE_DAY <= $TOTAL_REMAIN_HRS) 
{
  //do something
}

Where $AVE_LEAVE_DAY = 8 and $TOTAL_REMAIN_HRS = 8;

Why is it that the IF condition is not triggered?

Thanks
nick

 
I can't see a reason why it wouldn't be triggered! Your syntax is correct.

I can only assume that somewhere the variable is changing where you don't expect it.

Just to be sure, right above your if statement, echo out values of the two variables.

[cheers]
Cheers!
Laura
 
yes thats what i did and thats where i verified that they were both the same values!

i don;t know but could it be that one can store float and the other integer! and this puzzles the condition?? shouldn't be !!

Well thanks
Ncik
 
Just for testing that print out the result of gettype() for the both variables and you'll see.
 
hmm..i'll try it next monday! thanks!
 
Ok i tried the above and the results are:

$AVE_LEAVE_DAY = integer
$TOTAL_REMAIN_HRS = double

Could this pose a problem for the above query!?

Tahnks again
Nick
 
works ok for me ... unless theres an element of this thread that only I cannot see .. :-)

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top