This topic is locked
[SOLVED]

 cauculate balance

1/8/2010 7:53:24 PM
PHPRunner General questions
O
onlline author

global $data,$conn;

$str = "select sum(received) - sum(refunded) from financial

where IDmember=".$_SESSION[$strTableName."_masterkey1"];

$rs = db_query($str,$conn);

$data = db_fetch_numarray($rs);
$values["Balance"] = $data[0]+$values["received"]-$values["refunded"];
encontred an error Undefined variable: strTableName

Sergey Kornilov admin 1/10/2010

I would suggest to replace $strTableName with the actual table name i.e. $_SESSION["mytable_masterkey1"]

O
onlline author 1/10/2010



I would suggest to replace $strTableName with the actual table name i.e. $_SESSION["mytable_masterkey1"]


Hi!
database: open
table: caixa
fields: f_descricao f_entrada f_saida f_valor f_venc
I really need and following

cntrolar input and output of money and know the current balance.
example
enstrada $ 500.00 Departure $ 300.00 current balance $ 200.00
would be just that I have to do?

O
onlline author 1/10/2010

Resolved !
$values["Balance"] = $data[0]+$values["received"]-$values["paid"];
Insert ins EVENTS ADD PAGE/BEFORE RECORD ADDED and EDIT PAGE/BEFORE RECORD UPDATED
Tanks!