title: Move position of MySQL row up/down using php
body: <p>I am fetching my page's menu from a MySQL table as an unordered list <code>&lt;ul&gt;&lt;/ul&gt;</code> ORDERERED BY their position, Here is my MySQL table's  screenshot
   <br /><br />
  <img src="https://i.stack.imgur.com/9ozIs.jpg" alt="enter image description here"></p>
  
  <p>I want my query to work in a way like  when I fetch record of page_id_pk=3, it SET its page_position from 3 to 2 and updates it so now it holds page_position 2. The rest of the pages (rows) move down by an increment of one. <strong>I don't want to just swap two rows but to change their position</strong> i.e their page_id_pk sequence will remain same just their position gets changed. <br /><br /></p>