Answer the question
In order to leave comments, you need to log in
Is it possible to write one request?
There is a table with fields id and active (0 or 1).
Only one row can have active=1.
So here's the task: to make the selected row active by its id.
I can make two requests:
1. make active 0, where it was 1 (Update table SET active=0 WHERE active=1)
2. make active 1, where our id is. (Update table SET active=1 WHERE id=:id)
Is it possible to somehow combine them into one?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question