global $user; $result = db_query_range(db_rewrite_sql("SELECT m.field_mun_taxonomy_value FROM {content_type_municipal} m INNER JOIN {node} n ON n.nid = m.nid WHERE n.status = 1 AND m.field_mun_user_uid =" . $user->uid), 0, 10); $tmpnode = db_fetch_object($result); if ($tmpnode) { $value = $tmpnode->field_mun_taxonomy_value; return array(0 => array('value'=>$value)); } else { // no municipal found with the current uid return array(0 => array('value'=>NULL)); }