You are here

function top_searches_collect_results in Top Searches 7

Same name and namespace in other branches
  1. 5 top_searches.module \top_searches_collect_results()
  2. 6 top_searches.module \top_searches_collect_results()
1 call to top_searches_collect_results()
top_searches_block_view in ./top_searches.module

File

./top_searches.module, line 163

Code

function top_searches_collect_results() {
  $limit = variable_get('top_searches_block_items', 50);
  $result = db_query("SELECT q, counter FROM {top_searches} ORDER by counter DESC LIMIT {$limit} ");

  //:limit_rows", array( ':limit_rows' => variable_get('top_searches_block_items', 50)));
  $top_searches = array();
  while ($row = $result
    ->fetchObject()) {
    $top_searches[] = $row;
  }
  return $top_searches;
}