Thread: syntax error???
View Single Post
Old 08-03-2011, 04:16 PM   #4 (permalink)
maeltar
The Acquainted
 
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 137
Thanks: 3
maeltar is on a distinguished road
Default

Now try the code with one of the vars

Code:
$up = 2;
$app = 2;
$dep = 2;

// Incorrect value..
$sold = 5;

  If ( ( ($up == 2) || ($app == 2) || ($dep == 2) || ($sold == 2) ) )
  {
      echo "OR is TRUE<br />";
  } else{
      echo "OR is FALSE<br />";
  }
  
  If ( ( ($up == 2) && ($app == 2) && ($dep == 2) && ($sold == 2) ) )
  {
      echo "AND is TRUE<br />";
  }else{
      echo "AND is FALSE<br />";
  }
?>
__________________
Thanks... Simon

Sex, Drugs & Linux Rules
Send a message via MSN to maeltar
maeltar is offline  
Reply With Quote