Best way to change order of rows in MySQL table?
<p>I have a MySQL table with rows that need to be sorted in a particular order decided by the user. In other words, need the user to be able to insert a new row at a random point in the table, and also move existing rows to a new random location/row number in the table output on a select query... </p>

<p>Solutions I have thought of so far:</p>

<ol>
<li><p>I could use an integer with an ORDER BY, however,  then i will need to update every row after the point of "insertion".  </p></li>
<li><p>I could use a timestamp and an index integer, set the index integer of the new row to be equal to that of the row currently occupying the point of insertion, and then in the query first order by index, then by timestamp, but the "updating all" problem still occurs when i want to move an old row to a new index, instead of insert a new one.</p></li>
</ol>