<?php $orders = db ( "ARRAY * FROM orders WHERE status = {0}", [ 'open' ] ); $total = padArrSum ( $orders, 'amount' ); ?>