title: Delete duplicate rows if two variables match PHP
body: <p>I have two variables $faceplateInstalled and $faceplateExists and I print them into two columns</p>
  
  <pre><code>Faceplate Exists    Faceplate Instaled  
  1                           1   
  1                           0   
  1                           1   
  0                           0   
  1                           1   
  1                           0   
  1                           1   
  1                           1   
  0                           0   
  0                           0   
  1                           0 
  </code></pre>
  
  <p>Is there a way to remove entries where I have 1 and 1 in a same row?</p>
  
  <p>This is a query I use:</p>
  
  <pre><code>"SELECT F.id AS faceplateId, PR.premiseId, ComposeAddressFromPAF( PR.postAddressId ) AS fullAddress, " .
              "   IF( F.id IS NOT NULL, 1, 0 ) AS faceplateExists, " .
              "   IFNULL( F.installed, 0 ) AS faceplateInstalled, " .
              "   PR.siteId, S.NAME AS siteName " .
              "FROM ho_crm_premise PR " .
              "   LEFT JOIN ho_faceplate F ON F.premiseId = PR.premiseId " .
              "   INNER JOIN bcube_site S ON S.SITEID = PR.siteId " .
              "WHERE S.SITEID";
  </code></pre>
  
  <p>and this is whole function</p>
  
  <pre><code>function GetFaceplates( $siteId )
      {
          $sSql =
              "SELECT F.id AS faceplateId, PR.premiseId, ComposeAddressFromPAF( PR.postAddressId ) AS fullAddress, " .
              "   IF( F.id IS NOT NULL, 1, 0 ) AS faceplateExists, " .
              "   IFNULL( F.installed, 0 ) AS faceplateInstalled, " .
              "   PR.siteId, S.NAME AS siteName " .
              "FROM ho_crm_premise PR " .
              "   LEFT JOIN ho_faceplate F ON F.premiseId = PR.premiseId " .
              "   INNER JOIN bcube_site S ON S.SITEID = PR.siteId " .
              "WHERE S.SITEID";
  
          if( $siteId )
          {
              $sSql .= "   AND PR.siteId = " . $siteId . " ";
          }
  
          $pResult = $this-&gt;ExecuteSQL( $sSql );
          return $pResult;
      }
  
  
  $db = new DatabaseInfinity();
  
  $action = $_REQUEST["action"];
  
  //$action = "SEARCH"; // TEMPORARY
  $siteId = $_REQUEST["siteId"];
  
  if( $action == "SEARCH" )
  {
      $faceplates = $db-&gt;GetFaceplates( $siteId );
  
      while( $faceplate = FetchObject( $faceplates ) )
      {
          $tpl-&gt;newBlock( "FACEPLATE");
          $tpl-&gt;assign( "ID", $faceplate-&gt;faceplateId );
          $tpl-&gt;assign( "PREMISEID", $faceplate-&gt;premiseId  );
          $tpl-&gt;assign( "ADDRESS", $faceplate-&gt;fullAddress );
          $tpl-&gt;assign( "SITEID", $faceplate-&gt;siteId );
          $tpl-&gt;assign( "SITENAME", $faceplate-&gt;siteName );
          $tpl-&gt;assign( "FEXISTS", $faceplate-&gt;faceplateExists );
          $tpl-&gt;assign( "FINSTALED", $faceplate-&gt;faceplateInstalled );
      }
  }
  </code></pre>