Dumb question no 1241

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
davidjwest
Forum Commoner
Posts: 67
Joined: Sat Nov 06, 2004 5:26 am
Location: Leeds, Yorkshire, England

Dumb question no 1241

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

add another set of parens around the two..
davidjwest
Forum Commoner
Posts: 67
Joined: Sat Nov 06, 2004 5:26 am
Location: Leeds, Yorkshire, England

Post by davidjwest »

Thanks!

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

:D
Post Reply