Fix for Why doesn't node_save work in this simple example?

  1. <?php
  2.  
  3. // Bootstrap Drupal
  4. require 'includes/bootstrap.inc';
  5. drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
  6.  
  7. // Attempt the DB query
  8. $node = db_query("SELECT nid FROM {node} WHERE nid=11");
  9. $node->title = $node->title;
  10. node_load($node);
  11. node_save(&$node);
  12.  
  13. ?>

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.