Forum Moderators: coopster
Help would be much appreciated!
Anyways one of these users has 6 different items that were lined up like this
1
2
3
4
5
6
She deleted item 1 on accident and then recreated it so now the results show up like this
2
3
4
5
6
1
so i'm trying to move 1 back to where it should be. Is there a way to do it?
2 row 356
3 row 360
4 row 362
5 ''
6 ''
1 row 600 <-- the info here used to be on row 355 so it showed up first.
In the 3 years that this site has been up this is the first accurence of a person being this picky about the way their info is shown.
userid722 2 row 356
userid722 3 row 360
userid722 4 row 362
userid722 5 ''
userid722 6 ''
userid722 1 row 600 <-- the info here used to be on row 355 so it showed up first.
SELECT ... ORDER BY userid, sequence
?
That said, about the best way I can figure to get things back in order for now would be...
This will probably only take a few minutes to do. You may want to LOCK TABLES [mysql.com] before starting though.
I can't think of any other alternatives right now.
Ok, I had a similar situation where my boss is constantly asking me to change the order of categories on our web site. He asks me to change the order of this category field all the time and it has nothing to do with alphabetical or numerical order. So, you can see how this would be a pain.
What I did to solve this was add a display_order field to the database and do an ORDER BY clause on the display_order field. And I don't differ the records in this field by one. I differ them by 50 so I can switch records in and out at his every whim.
You can increment this field out any number you want, but I suggest going no lower then 10.
So, in case this happens again, you can take that 1 and give it a value in the display_order field of 10, the next one can be 11,12, 15, 18 , etc. This way, you have slots in between those records to switch records in quickly and without hassle.