node_example_update

Versions
4.6 – 7
node_example_update($node)

Implementation of hook_update().

As an existing node is being updated in the database, we need to do our own database updates.

Code

developer/examples/node_example.module, line 187

<?php
function node_example_update($node) {
  db_query("UPDATE {node_example} SET color = '%s', quantity = %d WHERE nid = %d", $node->color, $node->quantity, $node->nid);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.