title: I cannot make the condtion: cart_locked==0 && cart_archive==0 to work. All is deleted at 30 min page reload
body: <p>I have this code that is not following the conditions I wanted: All is deleted at page reload.</p>
  <pre><code>//START CONDITION TO DELETE OLD CARTS
  //TASK -&gt; Delete OLD CART  that is NOT FINISHED from database automatically after 30 min
  //CONDITION 1 -&gt; Delete OLD CART if cart_locked == 0 &amp;&amp; cart_archive==0 ( both conditions must be true.)
  //CONDITION 2 -&gt; Do not delete the OLD CART if cart_locked == 1 &amp;&amp; cart_archive==0
  //CONDITION 3 -&gt; Do not delete the OLD CART if cart_locked == 0 &amp;&amp; cart_archive==1
      
      $cart_condition = DB::query ( &quot;SELECT cart_locked,cart_archive FROM cart_details&quot; ); //OK
      foreach ($cart_condition as $row) {
       $cart_locked = $row[ 'cart_locked' ];
       $cart_archive = $row[ 'cart_archive' ];
      }
              
  
  //DELETE anything from cart_details if cart_locked==0 &amp;&amp; cart_archive==0,  both conditions must be true.
  //mysql_server is local time of server (datetime) where cart is created this is the time that trigger the +30 minutes deletion after reload.
          
      if (($cart_locked == 0 ) &amp;&amp; ($cart_archive == 0 )) {
      DB::query (&quot;DELETE FROM cart_details WHERE `mysql_server` &lt; NOW() - INTERVAL 30 MINUTE &quot;);
      }
  </code></pre>
  <p>//PROBLEM: I cannot make the conditions I wanted to be able work properly. Whatever I do, All is deleted from cart_details table at 30 minutes page reload<br>
  if cart_locked == 1 &amp;&amp; cart_archive==0 ---&gt; Nothing should deleted at 30min page reload<br>
  if cart_locked == 0 &amp;&amp; cart_archive==1 ---&gt; Nothing should deleted at 30min page reload<br>
  if cart_locked == 0 &amp;&amp; cart_archive==0 ---&gt; All should be deleted at 30min page reload, That what I want to achieve here.<br></p>
  <p>Thanks for your help.</p>