I have the nodereferrer module installed and want to use data in a field in the node that refers to this node. This is the code I used
$r= db_result(db_query("SELECT `nid`FROM `content_field_recordingparts`WHERE `field_recordingparts_nid` = %d",$node->nid));
$node_field['value'] = db_result(db_query("SELECT field_recordingid_value FROM content_type_recording_data WHERE nid=%d",$r)) . "." . $node->field_recordingnum['value'];
recordingdata has a node reference set up on recordingparts, and the reference between the recordingdata nodes (nid) and recordingparts nodes (field_recordingparts_nid) is stored in a table called content_field_recordingparts. The data I want is in the recordingid field on the recordingdata node, and I want to append a "." and the value of another field in the current node.
hope this makes sense and is helpfull to others. I'd be interested if there was a simpler way of doing this!