There is a table with two columns, the first column is the name, the second is the sum. How do I calculate the entire amount and display it in html.

I know how to make a request, I don’t understand how to display all this on php

SELECT SUM( `sum` ) FROM actualparish 

    1 answer 1

    Use PDO.

     try { $dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass); foreach($dbh->query('SELECT SUM( sum ) FROM actualparish') as $row) { print_r($row); } $dbh = null; } catch (PDOException $e) { print "Error!: " . $e->getMessage() . "<br/>"; die(); } 

    An example from the documentation.