Custom sql querys in drupal

I wanted to create a view to a block that displays latest 2 news, courses that haven´t started yet and vacancies if existing. This is addressed with a union query that is written into a module. Followed this tutorial:

It is a good idea to debug custom sql queries with phpmyadmin. Correct formatting of the custom made php modules is crucial, as the opening php tag and the commented $Id have to be in different lines, as such:

// $Id: custom_views.module,v 20010/05/07 12:25:24 goba Exp $

…otherwise we can get “cannot modified header information – headers already sent by” error, as detailed in:


Posted on July 7, 2010, in Uncategorized. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: