Reply to Re: whats wrong with this statment?

Your name:

Reply:


Posted by Lee David on 05/27/05 00:21

Let's say $myrow[status] = "n". The if statement is true because it is not
"u". Let's say it is "u". The if statement is true because it is not "n".
Let's say it is "x". The if statement is true because it is not "n".

I would do it this way :
$status = strtolower($myrow[status])
if (&status = "n" || & status = "u")
{
// do yes stuff (nothing in this case)
}
else
{
// do your not n or u stuff
}

HTH,
Lee


"Brian" <not@given.com> wrote in message
news:C%ple.24$Mi4.23@newsfe2-win.ntli.net...
> Hi all
>
> whats wrong with this?
>
> if ( (strtolower($myrow[status]) != 'n') || (strtolower($myrow[status]) !=
> 'u') ) {
> .......
> }
>
> I'm trying to say if $myrow[status]) if not 'n' or 'u' then do X but it's
> just not
> playing ball here? I have tried putting in brackets, taking them out,
> moving
> them about and all sorts, just can't get it to work
>
>
>
> Brian
>
>

[Back to original 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

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