Drupal 6 node_load with conditions Here is the situation:

I have two content types. Content type a has a CCK reference field for content type b.

Now I am trying to load all the nodes from content type a that are referenced to content type b.

Here is the code that I have.

$nidcur =  $fields['nid']-&gt;content;

$node = node_load(array("field_micselect" =&gt; $nidcur));

dpm($node);


So I would like to load all the nodes that are related to the nid $nidcur.
This should work for you:

$referenced_nodes = db_query("SELECT `field_FIELD_NAME_nid` AS `nid` FROM {content_field_FIELD_NAME}");
while ($referenced_node = db_fetch_object($referenced_nodes)) {
  $node = node_load(array('nid' =&gt; $referenced_node-&gt;nid));
  // Do your stuff here
}