ruby88 Posted March 13, 2007 Share Posted March 13, 2007 Hi, I have a php page that list the items, for each item I want to have a "Move up" and "Move Down" button, so user can click on it to sort the list, for example, user click on "Move up" on item 3, it will become item 2, the original item 2 will become item3. Anyone can provide a php code sample to do the tasks? Much appreicate it. Ruby Quote Link to comment https://forums.phpfreaks.com/topic/42557-move-updown-code-help/ Share on other sites More sharing options...
boo_lolly Posted March 13, 2007 Share Posted March 13, 2007 this is usually pretty simple. you're going to need a column in your items table in your database that stores this information. have a dropdown menu next to each item when the list is populated. this dropdown list will be pre-selected, meaning if an item is in spot #3, the dropdown menu next to it will already have 3 selected. these items will all be within an HTML form, and upon submitting the form, it will update these fields in the specified column, and then, populate the list again with the same mysql_query as before. Quote Link to comment https://forums.phpfreaks.com/topic/42557-move-updown-code-help/#findComment-206526 Share on other sites More sharing options...
artacus Posted March 13, 2007 Share Posted March 13, 2007 This really should be done client side in Javascript. Quote Link to comment https://forums.phpfreaks.com/topic/42557-move-updown-code-help/#findComment-206527 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.