By pmomidi on
I am trying to use this php block snippet and my site dies when I add this block.
// comma separated lists of terms tid to display nodes
$terms = "1";
// the number of nodes to show
$count = 5;
$sql = "SELECT distinct n.title, n.nid FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid in ($terms) AND n.status=1 ORDER BY n.created DESC";
$result = db_query_range(db_rewrite_sql($sql), 0, $count);
if (db_num_rows($result)) {
return node_title_list($result);
}
return t('No nodes available.');
Got this script from the below URL.
http://drupal.org/node/135344
Comments
You're using snippets for
You're using snippets for 5.x in your 6.x installation. That often fails.
Compare the results here: http://drupal.org/node/44854