You are here: Re: When can I use "OR" « PHP Programming Language « IT news, forums, messages
Re: When can I use "OR"

Posted by Smitro on 09/16/05 12:30

Cylindric wrote:
> Smitro wrote:
>
>>Hi,
>>
>>How come in some statements I can use:
>>
>>If (something) or DIE();
>>
>>but other times it won't work (returns an error) unless I take out the
>>OR.
>>
>>Is there any documentation on this anywhere?
>
>
> Think of it from a conversational point of view:
>
> PHP: "If (something) or DIE();"
> ENG: "If MyName=Fred Or Then DoSomething" makes no sense
>
> PHP: "If (something or somethingelse) Then Die();"
> ENG: "If MyName=Fred Or MyAge=92 Then DoSomething" makes sense
>
> PHP: "If (something) then DIE();"
> ENG: "If MyName=Fred Then DoSomething"
>

yep, got a point, I was trying to revese and if
statment, but then my other brain kicked in and
said, just stick some more brackets around it.

eg.
If ((something) and (something else)) or Die();

is now...

If (!((something) and (something else))) die();

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация