Re: logic operands problem
| From: | Thales Jacobi | Date: | Mon, 07 Dec 2009 11:12:23 +0000 |
| Subject: | Re: logic operands problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-300267@lists.php.net to get a copy of this message | ||
I think you could use another braket on the second example:
((page== 1 OR page== 3) AND page!= 2) OR ((page== 2 OR page== 3) AND page != 1)
Other than that I don't think I can help.
How come the page can be 1 or 3, but not 2?
I think you could change the logic, but I don't have enough info about your code. If page is 1 or 3, it won't be 2 (obviously), but why 2 or 3 is acceptable?
"Merlin Morgenstern" <merlin_x@fastmail.fm> wrote in message news:8E.77.13248.A9EDC1B4@pb1.pair.com...
Hello everybody, I am having trouble finding a logic for following problem: Should be true if: page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3 The result should never contain 1 AND 2 in the same time. This obviously does not work: (page = 1 OR page = 3) OR (page = 2 OR page = 3) This also does not work: (page = 1 OR page = 3 AND page != 2) OR (page = 2 OR page = 3 AND page != 1) Has somebody an idea how to solve this? Thank you in advance for any help! Merlin