On Mon, 2006-17-04 at 16:03 +0100, Graeme McLaren wrote: > Hi all, I need to order some data and I'm not exactly sure how to go about > doing it. Say I have 10 records displayed on a web page and I have an "Up" > and "Down" link which allows the user to move each record up by one or down > by one. The problem I have is that I can't just get the current position > and increase/decrease by one because there will be duplicate values for the > record which as been updated so there would then be two records with the > position "5" for example which causes a problem because an "order by number > asc" statement is going to have two values and as these values are equal > there will be a conflict - which one gets ordered first? > > > Any idea how I would solve this? > > > Cheers, > > G :)
You would have to give each piece of data an unique ID. This ID would be "returned" with the Up or Down link. Regenerate the ID with every page. -- __END__ Just my 0.00000002 million dollars worth, --- Shawn "For the things we have to learn before we can do them, we learn by doing them." Aristotle * Perl tutorials at http://perlmonks.org/?node=Tutorials * A searchable perldoc is at http://perldoc.perl.org/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>