How to pass value from master table to details table.
For example I have 2 tables
Table1 (master)
Fields = ID, Totals
Table 2 (details)
Fields = ID, PaymentTotal
I want to pass the value form Table 1 (Totals) to PaymentTotal in Table 2. (v2022)
How to pass value from master table to details table.
For example I have 2 tables
Table1 (master)
Fields = ID, Totals
Table 2 (details)
Fields = ID, PaymentTotal
I want to pass the value form Table 1 (Totals) to PaymentTotal in Table 2. (v2022)
In the detail table you only know the foreign key, you may get a value of the master record by, e.g.
$myValue = ExecuteScalar("SELECT `MyField` from `MyMasterTable` WHERE ID = " . $this-><MyForeignKeyField>->CurrentValue); // You need to replace field/table name by your actual ones