You are here

function _votingapi_distinct_values in Voting API 5

2 calls to _votingapi_distinct_values()
votingapi_vote_handler in ./votingapi_actions.inc
votingapi_vote_result_handler in ./votingapi_actions.inc

File

./votingapi.module, line 598

Code

function _votingapi_distinct_values($field = 'tag', $table = 'vote') {
  static $cached;
  if (!isset($cached[$table][$field])) {
    $results = db_query("SELECT DISTINCT %s FROM {votingapi_%s}", $field, $table);
    while ($result = db_fetch_object($results)) {
      $cached[$table][$field][] = $result->{$field};
    }
  }
  return $cached[$table][$field];
}