I'm not a DBA or SQL developer of any sort, but I have a challenge. What I want to do is update multiple fields of a row, when one of the other fields is updates.
Basically I'm tracking object views. I have a table called itemViews. It has the following fields:
using some PHP code, whenever an object is viewed, I'm updating the totalViews field.
What I'm looking for is a trigger than when an objects totalViews field is updated (increments by 1) that each of the other fields is incremented by 1. Is this possible, and if so could you post some sample code?
What I'm hoping is that this can be done with a trigger rather than having to build a larger SQL query and execute that from PHP.
Thanks in advance.