Hi All

I am sure this is easy, but I can't make it work

I have two variable $sectionID and $categoryID. There are a whole pile of conditions that these could have but I want to pick out two: when $sectionID==4 and $catergory!=21 and $category is !=27

How do I write them into an if statement - I have tried variation of

if (($sectionID==4 && $categoryID!=21)||($sectionID==4 && $categoryID!=27)){


if (($sectionID==4) && ($categoryID!=21 || $categoryyID!=27) ){

but they don't seem to work

I guess I am missing something - can anyone please help

Thanks in advance

Recommended Answers

if ($sectionID==4 && $categoryID!=21 && $categoryyID!=27){
Jump to Post

All 2 Replies

if ($sectionID==4 && $categoryID!=21 && $categoryyID!=27){

Thanks for the quick reply - very helpful- and kinda obvious really, when you look at it!


Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.