The mysql statement in the list that exchanges locations of two rows

Source: Internet
Author: User
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? When the CI framework is used, what parameters need to be passed to the database when the slave and slave nodes are clicked? 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. (In the list of lines 2nd and 1st, what are the mysql statements that are exchanged between the locations of the two rows?


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)
------ Solution --------------------
The position column is added to the table, and the position column is updated.
------ Solution --------------------
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.
------ Solution --------------------
Reference:
Reference: adding a column of position columns to the table to move up and move down is 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.