I would like to have something like this :
+----------+------+-----+--------+
| image_id | good | bad | result |
+----------+------+-----+--------+
| 1 | 10 | 2 | x |
+----------+------+-----+--------+
| 2 | 4 | 1 | y |
+----------+------+-----+--------+
Where x and y is calculated automaticaly to be respectively 10 - 2 and 4 - 1. (good - bad) -avoid negative number if possible-
I would like this value to change if values (good or bad) changes as well.
+----------+------+-----+--------+
| image_id | good | bad | result |
+----------+------+-----+--------+
| 1 | 10 | 2 | x |
+----------+------+-----+--------+
| 2 | 4 | 1 | y |
+----------+------+-----+--------+
I can do this in php but is there a way to do this directly with MYSQL ?