[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 362
  • Last Modified:

two conditions on an if statement

I'm trying to match two conditions in an I statement. If both match then I'd like the code
 $INTUNDER2519999 +=1;  to be executed. Whats wrong with my below code?

if ($TicketPrices >= 25.99 && $TicketPrices <= 200) {
                 $INTUNDER2519999 +=1;
                 }

Open in new window

0
JPERKS1985
Asked:
JPERKS1985
  • 3
1 Solution
 
Thomas WheelerCommented:
what error are you getting?
0
 
JPERKS1985Author Commented:
No error, its just not incrementing when it should.
0
 
Thomas WheelerCommented:
after the if can you print the results to see what they are.
0
 
Thomas WheelerCommented:
it works for me

$TicketPrices = 50;
$INTUNDER2519999 = 10;
 
if ($TicketPrices >= 25.99 && $TicketPrices <= 200) {
                 $INTUNDER2519999 +=1;
    }
 
print $INTUNDER2519999;
 
 
prints 11

Open in new window

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now