Hi, I ask you for help.
In a table I added a new field (FIELD 3) in which I write the calculation of two other fields (FIELD 1 and FIELD 2).
How can I update the whole table?
FIELD1 | FIELD2 | FIELD 3 (FIELD 1+FIELD2)|
3 | 10 | 13 |
4 | 5 | NULL() |
6 | 4 | NULL() |
......
Thanks
Silvano
UPDATE TABLE
Re: UPDATE TABLE
Hello geppoleppo,
you can do it easily, just open the project folder
go to hooks file , then table name and put the following line in before inset and before update function , and it will sum them automatically
and if you want to get this calculation only on updating Field1 and Field2 , just add it in before update function
you can do it easily, just open the project folder
go to hooks file , then table name and put the following line in before inset and before update function , and it will sum them automatically
and if you want to get this calculation only on updating Field1 and Field2 , just add it in before update function
Code: Select all
$data['FIELD3'] = $data['FIELD1'] + $data['FIELD 2'];