Solved

two conditions on an if statement

Posted on 2009-04-08
4
342 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

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