|
Farek Beginner
Joined: 13 Oct 2004 Posts: 29
|
Posted: Thu Dec 10, 2015 7:10 pm
Summary of values in db |
I have created a db that keeps track of how much exp i have gathered.
But i dont get how to make a summary of all the values.
Example:
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Thu Dec 10, 2015 9:31 pm |
First you will need to be able to reference everything in your database:
%dbkeys
Then you need to loop through them all:
#FORALL
You will need a temporary place to store the information:
#LOCAL $variables
And then an easy repeatable way to repeat to process in other scenarios:
#FUNCTION
In the end you could get something like this:
Code: |
<func name="listAdder" id="3841">
<value>#FORALL %dbkeys( $dbList) {$total=($total+$dbList.%i)}
#RETURN $total</value>
<arglist>$dbList, $total</arglist>
</func> |
Paste that onto the XML tab.
Syntax for use would be @listAdder(@someListHere) |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Farek Beginner
Joined: 13 Oct 2004 Posts: 29
|
Posted: Sat Jan 02, 2016 9:34 am |
thanks for the help
|
|
|
|
|
|