Solved

two conditions on an if statement

Posted on 2009-04-08
4
304 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
  • 3
4 Comments
 
LVL 6

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 6

Expert Comment

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

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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 …

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now