?
Solved

two conditions on an if statement

Posted on 2009-04-08
4
Medium Priority
?
344 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
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.
Suggested Courses

770 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