Hi-
I'm trying to create a Global Tag that would allow me to show users the total numer of hits they have for all of their links. I currently use the following global to show the total number of hits for my site:
total_hits =>
sub { my ($total) = $DB->table('Links')->select(['SUM(Hits)'])->fetchrow_array; return $total;}
I can't seem to modify this correctly for a new global tag called total_user_hits to get it to show the total number of hits for a specific user that is logged in. Basically, I just want it to show the SUM(Hits) WHERE Username='---Currently Logged in Username--'. Does anyone know the proper syntax to do this in a global? It would be much appreciated!
-FrankM
I'm trying to create a Global Tag that would allow me to show users the total numer of hits they have for all of their links. I currently use the following global to show the total number of hits for my site:
total_hits =>
sub { my ($total) = $DB->table('Links')->select(['SUM(Hits)'])->fetchrow_array; return $total;}
I can't seem to modify this correctly for a new global tag called total_user_hits to get it to show the total number of hits for a specific user that is logged in. Basically, I just want it to show the SUM(Hits) WHERE Username='---Currently Logged in Username--'. Does anyone know the proper syntax to do this in a global? It would be much appreciated!
-FrankM