Re: MySQL IF ELSE in Query
I can say 1 thing: you can with (my) SQL (as far as I know) are not both an UPDATE and DELETE query do, though you use only 1 of 2 by a check, go to your PHP therefore need .
Re: MySQL IF ELSE in Query
This can happen. With SQL you can write triggers. You can write a trigger on the SQL DELETE statement to delete each one also update under certain conditions.
However, not all DBMS systems rather advanced feature of SQL you will need to search or MYSQL supports it.
Re: MySQL IF ELSE in Query
Triggers are available from MySQL 5.
You could use a stored procedure or stored function.
You can simply delete a run and if affected rows == 0 an update. (Or vice versa)