mkosmosports Posted October 5, 2006 Share Posted October 5, 2006 Ive got the strangest issue and Ive spent the last few hours on it!!Ive got this condition: if ($group != "13" && $season <= "2005") { header('Location: error.html'); }This works great, but wait, there is another group variable for which I want the season variable to be able to go lower than 2005. Logically, I would try the below condition.... if ($group != "13" || $group != "14") && $season <= "2005") { header('Location: error.html'); }But now, the "unless the groups are NOT 13 OR 14" condition does not work anymore. The second condition is the only one that works correctly. Is there a rule where you cannot have if (NOT EQUAL or NOT EQUAL)?Thanks for any advice....mkosmosports Quote Link to comment Share on other sites More sharing options...
Hi I Am Timbo Posted October 5, 2006 Share Posted October 5, 2006 if group != 13 || group != 14 is always true. It cannot be both, therefore, it is not one of them.You probably want an && between those as well. Quote Link to comment Share on other sites More sharing options...
mkosmosports Posted October 5, 2006 Author Share Posted October 5, 2006 ha...youre so right. how did this not occur to me..&& is the correct operator here not ||....Thanks Timbo Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.