Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Total number INT column display

Quote Reply
Total number INT column display
I have a INT type column, and would like the total number to be displayed on the front page. Are there any globals out there to add this column and display the result?

Thanks.
Quote Reply
Re: [joeybone] Total number INT column display In reply to
Hi,

Could you explain a bit more? Is this field in the Links table, or Category table?

Do you just wanna do a SUM of ALL the values held in those links. For example, if you have:

Field: 10
Field: 3
Field: 60

..then the outputted result would be 73 (i.e all them added together)

Is that what you're after?

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] Total number INT column display In reply to
Hi Andy,

I found the solution from a previous post you answered:

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

Thanks for your help.