Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to sum up array values?
    primarykey
    data
    text
    <p>To make it clear, here's the inputted data:</p> <p>Array ( [0] => Array ( [SiteID] => 147 [Amount] => 500.00 [TransactionType] => D )</p> <pre><code>[1] =&gt; Array ( [SiteID] =&gt; 145 [Amount] =&gt; 500.00 [TransactionType] =&gt; D ) [2] =&gt; Array ( [SiteID] =&gt; 145 [Amount] =&gt; 500.00 [TransactionType] =&gt; D ) [3] =&gt; Array ( [SiteID] =&gt; 147 [Amount] =&gt; 500.00 [TransactionType] =&gt; D ) [4] =&gt; Array ( [SiteID] =&gt; 146 [Amount] =&gt; 500.00 [TransactionType] =&gt; D ) [5] =&gt; Array ( [SiteID] =&gt; 146 [Amount] =&gt; 500.00 [TransactionType] =&gt; D ) [6] =&gt; Array ( [SiteID] =&gt; 145 [Amount] =&gt; 500.00 [TransactionType] =&gt; W ) [7] =&gt; Array ( [SiteID] =&gt; 145 [Amount] =&gt; 500.00 [TransactionType] =&gt; W ) [8] =&gt; Array ( [SiteID] =&gt; 146 [Amount] =&gt; 330.00 [TransactionType] =&gt; W ) [9] =&gt; Array ( [SiteID] =&gt; 146 [Amount] =&gt; 500.00 [TransactionType] =&gt; W ) [10] =&gt; Array ( [SiteID] =&gt; 3 [Amount] =&gt; 500.00 [TransactionType] =&gt; D ) </code></pre> <p>I need to get the sum of all the transactions the same SiteID and it's TransactionType. Like for example:</p> <p>D - Deposit, W - Redemption, R - Reload</p> <p>Result: <code>array ([147]=&gt;array([Deposit] =&gt; 1000, [Reload]=&gt;3000, [Redemption]=&gt;2000))</code></p> <p>Note: 147 is a SiteID.</p> <p>I need to compute the Deposit, Reload, Redemption of all the transaction of same SiteID.</p> <p>If SiteID exists more than once just add the Deposit, Reload and Redemption per cycle. :)</p> <p>Please response. Thanks and guide me in proper way!!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload