FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » AND and OR
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
AND and OR [message #182562] Fri, 16 August 2013 00:21 Go to previous message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma:
Senior Member
Hi,

Doing code cleanup; something that seemed so simple is giving me lots of
trouble for whatever reason.

Win 7, XAMPP, PHP 5.3, online forms:

In my cleanup efforts I've been trying to concatenate statements for
things like the following:

IF(strlen(var1) == 0) OR strlen(var2) == 0) OR strlen(var3) ==0))
{
code; notify user of errors that must be corrected.
}

I know OR is || and AND is &&, and have tried every combination of code
I can think of but I consistently get syntax errors and it never works.
Doing each var independently works fine; e.g. if(strlen($var) == 0)
{...}, works as expected, first time every time.

It's when I start to try to use AND or OR that I get in trouble; I
continually get syntax errors, suggesting I don't know what I'm doing,
which I guess is obvious.
At one time I had a downloaded code page explaining precisely how
to OR them together, but darned if I can refind it on my hard drive OR
online either! I just cannot locate the proper way to OR vars together.

Either a code example or URL to such a feature would be great! I am just
not finding anything on Google or otherwise to demo how it works!

Thanks in Advance,

Twayne`
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Function Problem
Next Topic: switch with case 0
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 02:11:16 GMT 2024

Total time taken to generate the page: 0.04196 seconds