find which field /fields are modified

Questionsfind which field /fields are modified
santosh asked 4 years ago

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
Abu Ghufran answered 4 years ago

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.

santosh answered 4 years ago

Can you please give an example of select posted value

Your Answer

19 + 20 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?