Solved

If not 5

Posted on 2009-07-09
2
160 Views
Last Modified: 2012-05-07
Can someone please change this code to say if $row_WAATKroi['printer'] does not equal 5 show this html code <li class="t5"><a href="#p7EPMc1_5" id="p7EPMtrg1_5">Running Costs</a></li>

<?php if ($row_WAATKroi['printer'] ==5) { // Begin Show Region ?>
        <li class="t5"><a href="#p7EPMc1_5" id="p7EPMtrg1_5">Running Costs</a></li>
        <?php } // End Show Region ?>

Thanks
0
Comment
Question by:petewinter
[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
2 Comments
 
LVL 39

Accepted Solution

by:
Roger Baklund earned 500 total points
ID: 24814636
When testing if the value IS 5 you use == and when testing if it IS NOT 5, use != like this:
<?php if ($row_WAATKroi['printer'] != 5) { ?>
  <li class="t5"><a href="#p7EPMc1_5" id="p7EPMtrg1_5">Running Costs</a></li>
<?php } ?>

Open in new window

0
 

Author Closing Comment

by:petewinter
ID: 31601646
Many Thanks
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
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 count occurrences of each item in an array.

707 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