This topic is locked
[SOLVED]

 View the last value

9/27/2013 8:34:50 AM
PHPRunner General questions
O
onlline author

View the last value
I am using the following code and it works perfectly
In the "Before process" event enter the following code:

$_SESSION['Total']=0;
In the "Before record processed" event enter the following code:

$_SESSION['Total'] += $data['Entry'] + $data['Output'];

CustomQuery("UPDATE your_table_name SET Total = ".$_SESSION['Total']." WHERE your_primary_field = ".$data['your_primary_field']);
I would like to show the last posted value but the sum is wrong


Thanks in advanced .

Sergey Kornilov admin 9/27/2013

Why do you think Saldo total is wrong? Looks right to me.
-777.78+111.11+222.22 = -444.45

O
onlline author 9/27/2013



Why do you think Saldo total is wrong? Looks right to me.
-777.78+111.11+222.22 = -444.45


I would like to show the latest balance value, not to the sum of total
My expectation was to show the last value 777,78
thanks in advanced

Sergey Kornilov admin 9/28/2013

You need to turn off the Totals feature then, insert 'PHP code snippet' there and use something like this in that code snippet:

echo $_SESSION['Total'];
O
onlline author 9/29/2013



You need to turn off the Totals feature then, insert 'PHP code snippet' there and use something like this in that code snippet:

echo $_SESSION['Total'];



Thanks ! 100% perfect.