if statement question

votter

New Member
Messages
34
Reaction score
0
Points
0
I was wondering if you were able to do an if statement which would be something like:

if ($money == 5) and ($lvl == 3)

Something like that, that's just an example, but was just wondering, or is it like:

if($money == 5; $lvl == 3) ?
 

Anna

I am just me
Staff member
Messages
11,739
Reaction score
579
Points
113
I'd say it's probably like the first, but with a slight difference:

if ($money == 5 AND $lvl == 3) possibly if (($money == 5) AND ($lvl == 3))
 

votter

New Member
Messages
34
Reaction score
0
Points
0
Ok, Thanks. :D. It is actually:

(if $money == 5 && $level == 3)

That's how it combines. :D.
 

freecrm

New Member
Messages
629
Reaction score
0
Points
0
Ok, Thanks. :D. It is actually:

(if $money == 5 && $level == 3)

That's how it combines. :D.

Cool - never knew that, I've always nested them like this:

<?php if (something==somethingelse){?>
<?php if (somethingelse==someone){?>
something=somethingelse and also someone.
<?php } else {?>
somethingelse doesn't equal someone.
<?php } ?>
<?php } else {?>
something does not equal somethingelse.
<?php } ?>

This wll solve a few problems!!
 

votter

New Member
Messages
34
Reaction score
0
Points
0
LOL, Ya, that might make it a little shorter and easier. lol.
 
Top