add_where() causes the view not to be displayed
It was a problem with accessing the global variables. In the end, I got it working with the following function:

function iamru_keyword_filter_views_query_alter(&amp;$view, &amp;$query) {

        $q1 = $GLOBALS["_POST"]["q1"];
        $q3 = $GLOBALS["_POST"]["q3"];

        if ($view-&gt;name == 'iamru_prepared_statement') {
            $query-&gt;add_table('field_data_field_keyword');
            $query-&gt;add_where(1,'field_data_field_keyword.field_keyword_value',  $q1, '=' );
        }

        if ($view-&gt;name == 'iamru_word_for_you_view') {
            $query-&gt;add_table('field_data_field_keyword');
            $query-&gt;add_where(1,'field_data_field_keyword.field_keyword_value',  $q3, '=' );
        }

    }