Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 803 Bytes

Cck.md

File metadata and controls

23 lines (19 loc) · 803 Bytes
  • Update a cck field

Way the nodereference count module save its data into its fields

  $count = nodereference_count_get_count($field, $nid);
  $db_info = content_database_info($field);
  $table = $db_info['table'];
  $column = $db_info['columns']['value']['column'];

  $update = new stdClass();
  $update->vid = $vid;
  $update->nid = $nid;
  $update->$column = $count;
  drupal_write_record($table, $update, 'vid');