Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

two conditions on an if statement

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to implement server side field validation and display customized error messages to the client.
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 a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

636 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