query builder

Events happening in the community are now at Drupal community events on www.drupal.org.
KingMoore's picture

Fetching CCK nodes spanning multiple Content Types

CCK: 6.x-2.1
Drupal: 6.8

I am working on a module that needs to fetch sets of nodes based on various criteria (I don't think the criteria isn overly important for this discussion). The content nodes may span all content types installed on the site. I need to fetch a list of all the nodes matching my requirements and all of their fields/content.

I need this basic functionality:

$result = db_query('SELECT * FROM {node} WHERE #my conditions are met#');
while($row = db_fetch_object($result)){
 
  $node = node_load($row->nid);

  ... do stuff ...

}
Read more
Subscribe with RSS Syndicate content