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)){
...

and

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
E

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.