jakeoh Posted March 14, 2009 Share Posted March 14, 2009 Hi, I am doing a simple CMS application for someone. On one page, the members of an association are listed. I want to give the CMS user the possibility to add and remove persons from the table, and to decide the order in which they are displayed (not alphabetically). Now my first idea is to create a "rank" column in the table, and then to order by this column when making the query. My question is: is it possible to have the user select the rank from a drop-down list, and then to update all other values in the column to a new value so that every rank is unique? For example, if the user selects "3" for "John Smith", then the current person with the "3" value will be bumped to 4, "4" bumped to 5, etc.? What would be the best way to achieve this? Thanks! Link to comment https://forums.phpfreaks.com/topic/149407-setting-display-order-according-to-rank-in-phpmysql/ Share on other sites More sharing options...
alphanumetrix Posted March 14, 2009 Share Posted March 14, 2009 don't feel like explaining how to do that, but to keep all the user id's unique is simple. all you have to do is set the field to autoincrement, and you won't ever have to worry about them doubling up. Link to comment https://forums.phpfreaks.com/topic/149407-setting-display-order-according-to-rank-in-phpmysql/#findComment-784697 Share on other sites More sharing options...
jakeoh Posted March 14, 2009 Author Share Posted March 14, 2009 don't feel like explaining how to do that, but to keep all the user id's unique is simple. all you have to do is set the field to autoincrement, and you won't ever have to worry about them doubling up. Thanks. However I am talking about a user selected "Rank" column or something similar, not the user ID. Link to comment https://forums.phpfreaks.com/topic/149407-setting-display-order-according-to-rank-in-phpmysql/#findComment-784698 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.