updating field value of a content type with query I have a problem, may you guys can help me :)

I have content type called book, and it has field called stock. Instead of using node_save() I want to update value of book stock using manual query. I have this query, if I run from MySQL client (heidisql ex) the value of book stock has changed already, but if I open the node of book nothing happen. Please help me guys..

node_save() method:

$node = node_load($id); // $id -&gt; node id (nid)
$node-&gt;field_stock_value[$node-&gt;language][0]['value'] = "whatever";
node_save($node);


my query:

db_query("update field_data_field_stock b left join field_revision_field_stock rb on b.revision_id = rb.revision_id set b.field_stock_value = '{$stock}', rb.field_stock_value = '{$stock}' where b.entity_id = {$nid}");


I want to use query instead node_save() because I want to perform batch set for updating node, and you know, node_save() is really weight.

thank you before, happy new year guys.. :D
Why not you use field API field_attach_update() instead, it can save the node_save() process.

For example take this.

  $node = new stdClass();
  $node-&gt;id = $id_value;          // node id
  $node-&gt;type = $bundle_value;  // aka content type

  $node-&gt;field_fieldname[LANGUAGE_NONE][0]['value'] = 'some value';
  field_attach_update('node', $node);


Reference: http://www.urbaninsight.com/2011/10/24/saving-nodes-fields-without-saving-node-itself