Skip directly to content

Error message

  • Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1818 of /homepages/0/d190592849/htdocs/spiffboy/includes/database/query.inc).
  • Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1818 of /homepages/0/d190592849/htdocs/spiffboy/includes/database/query.inc).

When to node_load and when to access the db directly in Drupal

on Wed, 01/05/2011 - 23:45

node_load() in Drupal 6 is very efficient in that when you load a node it will keep the fully loaded node in a static array. This means, for example if you load nid 23 and need information from that node in a different place, you can simply call node_load(23) and it will return the previously loaded node. There is no charge to you.

Pages