Drupal core function node_save() is used to save nodes and it is frequently used to programmatically alter and save nodes' data, which includes fields (aka CCK fields) as well. If you want to update a field of a node you could do it like following
$node = node_load($nid); $node->field_fieldname[LANGUAGE_NONE]['value'] = 'some value'; node_save($node);
However, there may be a case when you might want to save a node's field, but not the node itself. For example, you may not want to update the node's timestamp for the last update, because you want it to be changed by human user activity only. In another case, you may not want to call node_save() and thus invoke chain reactions such as email notifications when the node is updated. These two cases are what actually happened to me.
A Drupal function field_attach_update() may save your day if you encountered a similar problem that I had. You could actually replace node_save() with field_attach_update().
$node = node_load($nid); $node->field_fieldname[LANGUAGE_NONE]['value'] = 'some value'; field_attach_update('node', $node);