Solved

two conditions on an if statement

Posted on 2009-04-08
4
340 Views
Last Modified: 2012-05-06
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
Comment
Question by:JPERKS1985
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 7

Expert Comment

by:Thomas Wheeler
ID: 24104063
what error are you getting?
0
 
LVL 1

Author Comment

by:JPERKS1985
ID: 24104069
No error, its just not incrementing when it should.
0
 
LVL 7

Expert Comment

by:Thomas Wheeler
ID: 24104076
after the if can you print the results to see what they are.
0
 
LVL 7

Accepted Solution

by:
Thomas Wheeler earned 500 total points
ID: 24104077
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question