This topic is locked

calculate fields

12/30/2008 5:55:56 AM
PHPRunner General questions
M
munkeh author

Hi,
Is there a way to calculate 2 fields (from different tables) and show the result in lets say field 3 with phprunner?

I found a few topics here but none of them made any sense to me (im sure its me because im not very hardened with php)
Regards

bbarker 12/30/2008

Here's an example of what it's going to take to make it work. Good luck.
[codebox]$rs stands for result

=================================================

global $strTableName,$conn;
if ($_SESSION[$strTableName."_masterkey1"])
{
$rs = CustomQuery(Select "amountreceived", "amount refunded" as subbalance from financial where IDmember=".$_SESSION[$strTableName."_masterkey1"]);
$data = db_fetch_array($rs);
$strUpdate = "update financial set 'Balance' =".$data["subbalance"]."

where `ID`=".$_SESSION [$strTableName."_masterkey1"];
db_exec($strUpdate,$conn);

}[/codebox]