Remove "where" clause in views 3 I want to remove "where" clause for city and postal_code in the views query. I found an example online for D6. I tried to change it a bit but it's not working. The "where" clause is still there.
Below is my code. It was originally for D6.

function distsearch_views_query_alter(&amp;$view, &amp;$query) {
  if ($view-&gt;name == 'search' &amp;&amp; $view-&gt;current_display == 'page_3') {
    // Remove the exposed filter conditions from the WHERE clause (WHERE city = MyCityInput)
    // and remove the corresponding args that were passed via the exposed filters
    // This effectively turns the city and zip code exposed filters into just text fields
    // that get used in distprox_mini_exposed_filter_proximity();

    $city = $view-&gt;exposed_raw_input['city'];
    $zip = $view-&gt;exposed_raw_input['postal_code'];

    // Remove the city or zip arguments (from the exposed filters)
    foreach ($query-&gt;where[0]['args'] as $key =&gt; $arg) {
      if ($arg == $city || $arg == $zip) {
        unset($query-&gt;where[0]['args'][$key]);
      }
    }

    // Remove the corresponding WHERE clause additions
    foreach ($query-&gt;where[0]['clauses'] as $key =&gt; $clause) {
      if (strpos($clause, 'postal_code') !== FALSE || strpos($clause, 'city') !== FALSE) {
        unset($query-&gt;where[0]['clauses'][$key]);
      }
    }
  }
}
It was a lot easier than I thought. I dsm the query and did it like below. Not sure it's the perfect way to do it but it's working.

function distprox_mini_views_query_alter(&amp;$view, &amp;$query) {
//dsm($query);
  if ($view-&gt;name == 'search' &amp;&amp; $view-&gt;current_display == 'page_3') 
    unset($query-&gt;where[1]['conditions'][0]);
    unset($query-&gt;where[1]['conditions'][1]);
  }
}