How to make the php database table id show the sequence number increasing from 1 on the webpage

Source: Internet
Author: User
How does one set the id of the php database table to auto-increment in the database table with an ascending sequence starting from 1 on the webpage? however, sometimes data insertion fails or the id is inconsistent after data deletion. & nbsp; I want to make each piece of data 123456 when outputting a webpage ..... show & nbsp; in this order. I will try to teach the php database table id how to display the sequence number increasing from 1 on the webpage.
The id settings in the database table are auto-incrementing, but sometimes the data insertion fails or the IDs are inconsistent after the data is deleted.
I want to display each piece of data 1, 3, 4, 5, 6... in this order when outputting a webpage.

I tried to display a single page. The problem is that my data is displayed in the paging limit statement paging mode.
When the second page is displayed, it starts from 1 2 3 4 5...

This is not a simple question. please give me some advice.

------ Solution --------------------
You do not want to modify the table id, but display the continuous sequence number when displaying it.
Is that the case?
Sequence Number initial value = (page number-1) * Number of lines per page + 1
------ Solution --------------------
The first page is 1-10, the second page is 11-20, that is, the initial value (2-1) * 10, and then the output data cyclically. the sequence number also increments by 1.
------ Solution --------------------
Take a look at the paging class example and you will know how many pages are obtained by dividing the total number by the number of pages on each page, and the pages are listed cyclically.

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.