If possible get all vars from a node using only the "nid" in a fuction?

Comments

t10barba’s picture

$new_nid = "100";

$new_node = node_load($new_nid);

print_r($new_node);

carlmcdade’s picture

Possibly changed in version 5.xx but in all other versions

$new_node = node_load(array('nid' =>$new_nid));

Hiveminds Magazine - for web publishers and community builders
http://www.hiveminds.co.uk
http://demo.hiveminds.co.uk
Drupal Support Wiki | Drupal Sverige

coreyp_1’s picture

Both methods work in 5.x, but I believe that requesting the NID directly would be marginally faster.

- Corey

nevets’s picture

So if the same node is loaded twice on the same page the 2nd call uses data cached from the 1st call.

basicmagic.net’s picture

subscribe

Drupal samurai for hire, based in Buffalo, New York, USA.
15+ years Drupal, 20+ years web.
http://basicmagic.net