Reorder database rows

I am wanting for the user to be able to reorder the pages in the CMS. I have table called ‘pages’ with values ‘id’, ‘title’, and ‘maintext’. What is the best way to do this? It would be ideal to just have a button with an arrow that when clicked switches the id of the row above it.