On the database there is this table:
products:
id | name | type |
---|---|---|
1 | product 1 | 1 |
2 | product 2 | 2 |
3 | product 3 | 2 |
4 | product 4 | 1 |
5 | product 5 | 1 |
6 | product 6 | 1 |
7 | product 7 | 2 |
the select to extract them is:
select * from products order by id
This select sorts by id, so I will get this result:
But now they want that the administrator can change the order, so he can set a custom order. For example this:
As you can see it's a custom order, it doesn't sort by id but it is decided by the administrator, and I want that this order remains for every user, so it shouldn't be lost when page is refreshed.
Which is the best way to implement this?