title: How to change the order of a list?
body: <p>I'm using <code>PHP/MySQL</code> but just looking for pseudo-code really</p>
  
  <p>How can I allow a user to change which order a list of items displays?</p>
  
  <p>Say the user moves #4 to #1 do I change #4 to #0 then foreach row (1-3) increase it by 1 so it's 2-4 and then change #0 to #1?</p>
  
  <p>Is this the best way?</p>
  
  <p>Update: it's for a to-do list, and I won't just be swapping the order of items (i.e. swap #1 and #4 but will be moving items in front of others)</p>
  
  <p>I have the items in a SQL db with item_id, task, completed, order_id</p>
  
  <p>it's order_id that I need to change</p>