 <p>If you want to sum of amount then go with this</p> <p>Example SQL query:</p> <pre><code>select sum(column_name) as total from your table_name </code></pre> <p>Then fetch the result in PHP</p> <pre><code>echo $fetched_data['total']; </code></pre>