Hello, I would like to know how to add values that pass me from the server.
I created a system that controls the expenses / accounts, you register one of your accounts.
EX:
Home
Name: Car
Value: R $ 10,000 (per month)
Times: 5
Total: $ Value * Times. (R $ 50,000)
Name: House
Property Value: R $ 20,000 (per month)
Times: 5
Total: $ value * times. ($ 100,000)
But now I want to add the total from the first 'account' to the total of the second 'account'. How do I do that ?
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
}
?>