return 0 unless $count;
+ $count = 0;
+
my ($err, $errmsg) = $db->find($table, $condition);
croak "Unable to find $params{type} entries for $condition - $errmsg" if $err;
$db->lock('write', $table);
# Get all records for $userid and $type
- my $listrecs = $db->get($table, $condition);
+ my $listrecs = $db->get($table, $condition,'*', 'order by hit_count desc');
# Delete all of the list entries for this $userid and $type
my ($count, $msg) = $db->delete($table, $condition);