Hi-

A Drupal neu-b here - i love drupal a lot!

can anyone tell me if it is possible to edit the SQL statements created by views - i'm thinking especially of the WHERE clause

thanks!

jeff
los angeles

Comments

nevets’s picture

What are you trying to achieve, ie what is the view not doing that you want it to?

Jetson’s picture

i am trying to use ANDs and ORs

Anonymous’s picture

You can use hook_views_query_alter to alter the query that Views generates.

http://drupalcontrib.org/api/function/hook_views_query_alter

Jetson’s picture

where can i find more info about how to use hooks? not sure how to form a SQL Select in the hook?

Anonymous’s picture

Here is the Views online help: http://views-help.doc.logrus.com/
Here is the doc on hooks: http://api.drupal.org/api/group/hooks