Hi,
I would like to find and use which fields are being modified. Example if fieldX is modified I would like to change value of fieldY based on the new value of fieldX. Is this possible to do using update_modifier?
function update_modifier($data)
{
require("init.php");
require("config.php");
mysqli_query($con,"UPDATE tableA SET fieldY= ".$newValueOfFieldX + 1 ." WHERE id = {$data["id"]}");
}
3 Answers
To get changed fields, you need to run another SELECT query based on $data["id"] before UPDATE.
And then compare old values with posted values.
Your Answer