Without using Views, how can I create an RSS feed in Drupal 6?

1. I can't use Views because it won't let me drop a complicated SQL statement into it - it wants me to rebuild it from scratch, which leads to the possibility of errors. Plus, I don't think Views is capable of replicating the SQL statement.

2. I looked at a tutorial http://www.drupalcoder.com/story/17-creating-your-own-rss-feeds-with-dru..., but it seems to stop halfway through (and there's a PHP error in the code...). I'm no expert yet, so I need an end-to-end tutorial.

In short; I have an SQL View in my database. I need to show it as an RSS feed, somehow - creating it on the fly (because I need to supply some parameters), then making it available.

Regards,

Pete.

Comments

gilgabar’s picture

The tutorial example is broken. Look at http://api.drupal.org/api/function/blog_feed_last/6 for an example that works. In the tutorial he passed the sql object directly into the node_feed function, but the function expects an array. This is the part that was missing:

<?php
 $items = array();
  while ($row = db_fetch_object($nodes)) {
    $items[] = $row->nid;
  }
?>