I have a MySQL database full of products, Each product has a category. I want the owner of the store to be able to change the order in which the products are displayed on the site as he likes to tinker with order a lot.
My initial thought is to have a product order column but there is lots of issues with this as you'd need each category of products to have a separate ordering and all the products are in the one table i.e. Would need to have a Chair in Position 1 and also a Table in position 1, this is definetely achievable however the bigger issue lies with If i want to change the positioning of chair2 to position 1 then i'd have to update every other products column too. This is computationally expensive having to run potentially 100s of queries every time I change the order.
There must be an easy way to do this. I'm using MySQL and PHP. Any help is greatly appreciated.
Thanks.