Page 1 of 1

Dumb question no 1241

Posted: Thu Mar 10, 2005 3:52 pm
by davidjwest
OK, so what's the syntax for an or statement after an if

Code: Select all

if ($ls==0) or ($years<13)
{
  $grown=(($final*$growth)/100)+((($monthly*12)*$growth)/200);
}
This gives an error, no doubt I've done somthing wrong, someone please enlighten me!

As you can see I'm used to Spectrum BASIC and still getting to grips with the simpler commands in PHP.

Posted: Thu Mar 10, 2005 4:09 pm
by feyd
add another set of parens around the two..

Posted: Thu Mar 10, 2005 4:23 pm
by davidjwest
Thanks!

It works, no more dumb questions from me for a few more nanoseconds then.....

:D