I have a mysql table, which is shown on front end using php, and has basic functionalities like editing the rows and deleting them. But the user wants to move the rows up and down, so that they have their data in their own order. I was thinking of providing either arrows or something to move the row up and down, but I am finding difficult in how to update that backend database table after the user moves the row up and down. I searched for this on internet but could not find a specific solution to my problem, where it says do something on the html front end and then write this and this query using php or any other language to make this possible.
Asked
Active
Viewed 22 times
0
-
Looks like you may have to add an Order column – RiggsFolly Nov 17 '16 at 00:09
-
Reordering the rows in the database isn't something you can do. Like stated above you need another column that you can `ORDER BY` on. Then you just take the order of the rows on the screen and update that column with the order. – Jaime Nov 17 '16 at 00:18