If you have multiple if statements within a MySQL trigger, what is the best approach?
Currently my SQL looks like this:
IF NOT (NEW.status <=> OLD.status) THEN
{my sql}
ELSEIF NOT (NEW.actual <=> OLD.actual) THEN
{my sql}
END IF
On first sight this seems to work. However, I noticed that when multiple of the (else)if statements are true, only the first one gets executed (just like in PHP, for example).
How can I just use multiple if's, not necessarily elseif's, so that more than 1 statement is executed? Creating multiple triggers with the same action is not possible, at least that is what phpMyAdmin shows. Putting multiple if's in one trigger results in errors.