How to update multiple fields at once in mysql
<p>Hello i am building a school management system and i want to promote all the students with one click to the next class. I want whenever i press auto promote button then it updates database with next class for example </p>

<pre><code>update students 
set class=2 
where class=1 and 
set class=3 
where class=2 and 
set class=4 
where class=3
</code></pre>

<p>.</p>