Access node attributes from the API

mediumgrade - September 16, 2007 - 21:39

Okay, I have created a custom node using CCK called "business". I am trying to create a block which will display the businesses and their testimonials. Here is the code I am trying to use:

<?php

$sql
= "select * from {node} where type = 'content_business'";
$result = db_query(db_rewrite_sql($sql));

while (
$data = db_fetch_object($result)) {

 
$node = node_load($data->nid);

  print
$node->title."<br>\n";
  print
$node->field_testimonial."<br>\n";

}

?>

The title displays fine, but the testimonial only displays "Array". "field_testimonial" is the name shown in the "manage fields" section, but I must be missing something.

What gives?

 
 

Drupal is a registered trademark of Dries Buytaert.