Hello list. I am trying to do something that I know has been done before.

 

I have a list of promotions that I am getting from a database, and listing them by a field called Order. These promotions also have a unique ID with them.

I output them to a table and, to the right of each promotion title there is an up/down arrow so that the user can move them around. I know how to move them around in the browser, but I want to actually update the order in the database. The problem that I am having is making sure that I only change the order of the promotion just one above or below it, as well as the one I am moving. I am passing in the promotion ID and the Order number of the promotion that I want to move. So, how do I query for the record immediately above or below the one that I am moving? Does this make sense?

 

Thanks in advance,

 

Bruce

 

Reply via email to