title: PHP if $var equals to 1 set $var2 any number
body: <p>$varb and $varx are row entries in database table, they can be "0" or "1". I wanna set $varb2 "1" if $varb is 1(the same option for $varx2). </p>
  
  <p>I have to check each row.</p>
  
  <p>Here is code:</p>
  
  <pre><code>if($varb == 1){
   $varb2 == 1;
  }elseif($varx == 1){
   $varx2 == 1;
  }
  </code></pre>
  
  <p>And I select all entries that have "1" in their varb or varx(or both). </p>
  
  <p>Here is select:</p>
  
  <pre><code>SELECT * FROM news_articles
      WHERE varb = '$varb2' OR varx = '$varx2' 
      ORDER BY rand()
      LIMIT 4";
  </code></pre>