well my function is this
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;
}
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.
 
    