Hey everyone. I have been trying to wrap my head around a problem, but have yet to come up with any sort of solution...
Basically what im trying to do is give the user the ability to sort records.. lets say photos for this example. So they will have a list of photos, and they can click on little down/up buttons and then the picture will move either one up, or one down in the list. And this order is saved in db by some numerical representation that can later called and displayed in the same order.
Im guessing it has some sort of number game to get this working.. but I cant figure out how to make it consistently work..
at first i was thinking of each photo haveing a number assigned to it, and when a photo gets moved up, just check the next highest number, and the one higher than that, and then jump in the middle of the two.. but after you do that a few times, the gap gets smaller and smaller...so yeah?