nimzie Posted February 18, 2010 Share Posted February 18, 2010 Hi, I'm trying to add a value to $node->field_spaces[x]['nid'] where x is the next available spot in the field_spaces array. Always adding to the next spot. I'll be calling this in a for loop to add things in there... Can anyone offer a hand? $node->field_spaces (array) $node->field_spaces[0] (array) $node->field_spaces[0]['nid'] Thank you, adam Quote Link to comment Share on other sites More sharing options...
schilly Posted February 18, 2010 Share Posted February 18, 2010 you mean like node->field_spaces[0][] = $nid; Quote Link to comment Share on other sites More sharing options...
nimzie Posted February 18, 2010 Author Share Posted February 18, 2010 I think what it has to do as it loops through the values to add is something like $node->field_spaces[0]['nid'] = $nid; $node->field_spaces[1]['nid'] = $nid; $node->field_spaces[2]['nid'] = $nid; $node->field_spaces[3]['nid'] = $nid; automatically as I iterate through things.... thank you for any help. cheers, adam Quote Link to comment Share on other sites More sharing options...
schilly Posted February 18, 2010 Share Posted February 18, 2010 Ok. node->field_spaces[] = array('nid' => $nid); I think that should do it. Quote Link to comment Share on other sites More sharing options...
nimzie Posted February 18, 2010 Author Share Posted February 18, 2010 thank you kindly for your help. Quote Link to comment Share on other sites More sharing options...
schilly Posted February 18, 2010 Share Posted February 18, 2010 np Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.