You are here

function recipe_insert in Recipe 6

Same name and namespace in other branches
  1. 5 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.

1 call to recipe_insert()
recipe_update in ./recipe.module
Implementation of hook_update().

File

./recipe.module, line 161
recipe.module - share recipes

Code

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