What are the mysql statements in the list that are connected to two rows for location exchange? How can I use PHP to implement the sorting function of "move up" and "move down? CI framework used
What parameters do I need to pass to the database when I click "batch" and "batch?
Move Up: click the up arrow in the action column of row 2nd. after the operation is completed, the original number of rows in the row 2nd is replaced with the number of rows in the row 1st. (Location of information exchange between 2nd and 1st rows)
Move down: click the downward arrow in the 9th rows operation. after the operation is completed, the original 9th rows are replaced by 10th rows. (Location of information exchange between 9th and 10th rows)
Reply to discussion (solution)
The position column is added to the table, and the position column is updated.
The position column is added to the table, and the position column is updated.
I have A sorting field (sort) in the table. The problem is that if I click the up arrow (forward) of row B, how can I get the parameters of row.
You should go to the language section to ask,
If your sort is unique, click the up arrow to obtain the current sort,
Lower is + 1, and upper is-1.
Reference the reply from rucypli on the first floor: add a column to the table and move up the position column to update the position column.
I have A sorting field (sort) in the table. The problem is that if I click the up arrow (forward) of row B, how can I get the parameters of row.
You can know the parameters of the current row. you must know the parameters of the previous row.