title: mysql query within function with 2argument
body: <p>well my function is this </p>
  
  <pre><code>function all_products($where, $condition, $where2, $condition2) {
      $query = "SELECT *
                FROM `product` 
                WHERE 
                ".mysql_real_escape_string($where)." = '".mysql_real_escape_string($condition)."'  
                and  
                ".mysql_real_escape_string($where)." = '".mysql_real_escape_string($condition)."' 
                ";
      $query_run = mysql_query($query);
      return $query_run;
  }
  </code></pre>
  
  <p>so whenever Im trying to use this function to fetch the data from db it returns rows even if only the $where and $condition is true and $where2 and $condition2 is false.</p>