views:

53

answers:

2

I need an OR clause in the arguments section of a view. So if a user passes 123, I'd like to return rows WHERE Field1 = 123 OR Field2 = 123.

I'm fairly certain this can't be done in the views interface (but please correct me if I'm wrong).

So I'm trying to rewrite the query. Where's the best place to do this?

I'm in hook_views_pre_execute(&$view) right now, but it looks like this would mean using text replacement on the final SQL string!

Is there a cleaner way to do this?

A: 

I've answered a similar question here

Basically you can use either views_or module or hook_views_query_alter.

googletorp
+1  A: 

You could try the Views Or module, or consider this other post.

Seb

related questions