node_example_insert

Definition

node_example_insert($node)
developer/examples/node_example.module, line 181

Description

Implementation of hook_insert().

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

Code

<?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);
}
?>
 
 

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.