This topic is locked
[SOLVED]

 Balance

9/22/2013 12:33:11 AM
PHPRunner General questions
O
onlline author

Hi1
I am using this code it works perfectly, but I would save the amount in the table

  1. Events Editor, Balance table: BeforeProcessList event:
    $_SESSION["Total"]=0;
  2. 'Total' field in Visual Editor. Set 'View as' type to 'Custom' and use the following code:
    $_SESSION["Total"] += $data["Entry"];

    $value = $_SESSION["Total"];
    $_SESSION["Total"] += $data["Output"];

    $value = $_SESSION["Total"];
    my fields Entry, Output, Total
    Thanks in advanced.

C
cgphp 9/22/2013

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']);
O
onlline author 9/22/2013



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']);



Cristian,
Perfect
Thanks .