You are here

function recipe_insert in Recipe 5

Same name and namespace in other branches
  1. 6 recipe.module \recipe_insert()
  2. 7.2 recipe.module \recipe_insert()
  3. 7 recipe.module \recipe_insert()

Implementation of hook_insert().

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

File

./recipe.module, line 85
recipe.module - share recipes for drupal 5.x

Code

function recipe_insert($node) {
  db_query("INSERT INTO {recipe} (nid, source, yield, notes, instructions, preptime) VALUES (%d, '%s', '%s', '%s', '%s', '%d')", $node->nid, $node->source, $node->yield, $node->notes, $node->instructions, $node->preptime);
  recipe_save_ingredients($node);
}