DB::select()->execute()
you will end up with an array no matter how many data you requested. Your query (the one you wrote first) thus returns an array which contains only one key (total
) and only one value for that key (the sum of that column).<?php echo $total['total']; ?>
or you'll do some pre-processing in the model to only return that value and 0 (zero) otherwiseIt looks like you're new here. If you want to get involved, click one of these buttons!