node_load

The S-Files: When node_load won't load, and the anonymous user has vanished

Robert Douglass's picture

Tech Support Case Studies

Use these two SQL commands to repair your Drupal 6 site to restore the anonymous user database record:

INSERT INTO users (name, mail) VALUES ('', '');
UPDATE users SET uid=0 WHERE name='';

The symptoms you'll see that tip you off that this is needed:
  1. node_load() is not loading nodes that you can prove are in the node table.
  2. node_delete() is not deleting nodes that you can prove are in the node table.
  3. The query SELECT * FROM users WHERE uid=0; returns zero rows.
Read full article