Gossamer Forum
Quote Reply
New total hits global ?
Hello,
I use a simple total hits global:

Quote:

sub {
my ($total) = $DB->table('Links')->select(['SUM(Hits)'])->fetchrow_array;
return $total;
}


but it counts a link twice if it is in 2 categories. I there a way to have the same global but that would consider each link unique even if they are in several categories ?

Thanks in advance,
Brakkar
Quote Reply
Re: [brakkar] New total hits global ? In reply to
I would personally do;

Code:
sub { return $DB->table('Links')->count(); }

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] New total hits global ? In reply to
I made a mistake, I gave the code I used to count the number of hits, not links.
But I wanted the number of unique LINKS, and thus, it seems your code works find for what I wanted.

Smart you.

Thanks,
Brakkar