node_example_insert

  1. drupal
    1. 4.7 node_example.module
    2. 5 node_example.module
    3. 6
Versions
4.7 – 6 node_example_insert($node)

Implementation of hook_insert().

As a new node is being inserted into the database, we need to do our own database inserts.

Related topics

Code

examples/node_example/node_example.module, line 212

<?php
function node_example_insert($node) {
  db_query("INSERT INTO {node_example} (vid, nid, color, quantity) VALUES (%d, %d, '%s', %d)", $node->vid, $node->nid, $node->color, $node->quantity);
}
?>