I tried very hard reading tutorials, but can't handle This. Im using foreach to display orders in table, but i need to sum coins value of this array and sort it by site value
foreach ($orders as $key => $order)
<td><?php echo $order->Id;?></td>
<td><?php echo $order->UserId;?></a></td>
<td><?php echo $order->Coins;?></td>
<td><?php echo $order->Site;?></td>
I wonder how i could group this orders in sql, becouse it needs to be grouped by User, and then by Site, and for every Site make sum of Coins