I'm trying to create an image gallery using PHP and mySQL and one of the things I need to do is be able to reorder my data; if the user wants image 3 where image 2 is ect. Now the only way I could figure out that may work is to store both image numbers in a variable and then replace the data with the number above it. In this way, I dont have to worry about repopulating all the data in the database to flow back in order. My question is in regards to what data? Right now, my table is set up as:
pic_ID----Name----Sub_Path---Real_Path
Where pic_ID is the primary key and is ordered incrementally. Would there be anything wrong with changing the data as it is stored in the pic_ID in the manner mentioned or do I need to created a new incremental, non primary key column called Position?
pic_ID----Name----Sub_Path---Real_Path
Where pic_ID is the primary key and is ordered incrementally. Would there be anything wrong with changing the data as it is stored in the pic_ID in the manner mentioned or do I need to created a new incremental, non primary key column called Position?