sum in PHP

Posted under » PHP on 14 March 2022

What I mean sum in PHP is like adding variables in excel.

This is the same with python django.

In php it may look like this.

if ($result = $dbhandle -> query("SELECT * FROM question")) {

while($row = mysqli_fetch_array($result)) {
    $sum += $row['value'];
    }
    echo $sum."
"; } $dbhandle -> close();

If you want to just increment or +1 use ++ just like this example.

web security linux ubuntu python django git Raspberry apache mysql php drupal cake javascript css AWS IOT