So, I have a table that includes 3 columns: ID, Name and ParentID. Something like that:
ID | Name | ParentID 1 Root NULL 2 Parent
After some manipulations using strings by the user, Ajax sends an array with a new order of strings by their identifiers. For example, it can be 4, 10, 2, 3, 11, 1, etc.
Question: what queries / queries can I use so that I can reorder rows in my table? So, I only have a row id and nothing else. And I need to move all the data in the row: with the name and ParentID (and not just with the ID). I want to get something like this:
ID | Name | ParentID 1 Root NULL 9 Child
Thank you very much.
source share