Blair Wadman 1 minute read

Number of results in a Drupal View

Find the number of results in a view. Add this snippet to the header or footer of the view, depending on where you want the number of results to be displayed.

From: http://drupal.org/node/131031

$view = views_get_current_view();

// execute view query
$view->execute();

// results are now stored as an array in $view->result
$count = count( $view->result );

print "Showing <b>$count</b> results";