'$anode->teaser' returns nothing.

$sql = "SELECT node.teaser" gets a error.

what can be the problem?

Comments

cog.rusty’s picture

The query fails because the teaser is in the 'node_revisions' table, not in the 'node' table.

Newsance’s picture

Sorry, I didn't get it. Can you help me to make this work:

$sql = "SELECT node.title, node.nid FROM node WHERE type='page' ORDER BY node.created DESC LIMIT 50" ;
$output .= "<ul>";
$result = db_query($sql);
while ($anode = db_fetch_object($result)) {
$output .= "<li>".l($anode->title, "node/$anode->nid")."</li>";
$output .= "<li>".l($anode->teaser, "node/$anode->nid")."</li>";

}
$output .= "</ul>";
$output .='<div class="more-link">'.l('more', 'node/'.$anode->nid).'</div>';
print $output;

Thanks.

cog.rusty’s picture

I replied to your other post here: http://drupal.org/node/322016#comment-1062358

timmillwood’s picture

you're not returning the teaser from the database

----------------------------------------------------------------
IB Community Theme http://communitytheme.ibo.org
Spun Designs http://www.spundesigns.net
Millwood Online http://www.millwoodonline.co.uk