rondog Posted April 26, 2008 Share Posted April 26, 2008 I have some images in the DB that creates an XML file to make a gallery. I am working on a back end gallery editor and I was wondering what the best way to make a re-order type function. I was thinking just doing "Move Up | Move Down" buttons so I would then need a way to swap their auto increment IDs. What do ya think? Link to comment https://forums.phpfreaks.com/topic/102998-re-ordering-a-gallery/ Share on other sites More sharing options...
Xurion Posted April 26, 2008 Share Posted April 26, 2008 You would be better having a different field in your database called 'position' and use that rather than your auto increment. Link to comment https://forums.phpfreaks.com/topic/102998-re-ordering-a-gallery/#findComment-527621 Share on other sites More sharing options...
rondog Posted April 26, 2008 Author Share Posted April 26, 2008 ok I guess that could work. Then what would I do to swap the one before or after it depending on if they hit move up or down?? Link to comment https://forums.phpfreaks.com/topic/102998-re-ordering-a-gallery/#findComment-527807 Share on other sites More sharing options...
BlueSkyIS Posted April 26, 2008 Share Posted April 26, 2008 add or subtract 1 from the position field. Link to comment https://forums.phpfreaks.com/topic/102998-re-ordering-a-gallery/#findComment-527809 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.