1
Hi, I’d like to know how to add up the values that pass me from the server.
I created a system that controls expenses/accounts, you register one of your accounts.
EX:
Name: Car
Value: R$ 10,000 (per month)
Times: 5
Total: $value * times. (R$ 50,000)
Name: House
Value: R$ 20,000 (per month)
Times: 5
Total: $value * times. (R$ 100,000)
GENERAL TOTAL ...(HOW TO DO ?)
Only now I want to add the total of the first 'account' to the total of the second 'account'. How do I do this ?
Code:
session_start();
include("includes/conexa.php");
require_once 'init.php';
require 'check.php';
$voce = $_SESSION['user_name'];
$id = $_SESSION['user_id'];
include("includes/topotw.php");
echo "$voce e Seu ID: $id";
echo "";
include('includes/conexa.php');
$consulta = $PDO->query("SELECT * FROM `contas` WHERE id_pessoa LIKE '%".$id."%'");
while($linha = $consulta ->fetch(PDO::FETCH_ASSOC)) {
header('Content-Type: text/html; charset=utf-8');
Conta:
{$linha['nome_conta']}
Valor:
R$ {$linha['valor_conta']}
Vezes a Pagar:
{$linha['vezes_conta']}
$vl = $linha['valor_conta'];
$vx = $linha['vezes_conta'];
$total = $vl * $vx;
Total:
$total
}
?>
Andre Junior, show the code
– user60252
Okay, I’ll edit it out.
– Andre Junior