MySQL automatic number field
When creating a table:
Create Table 'mydatabase'. 'mytable '(
'Id' integer unsigned not null auto_increment,
...
...
Primary Key ('id ')
)
If the table already exists, modify it.
Alter table 'mydatabase'. 'mytable'
Modify column 'id' integer unsigned not null auto_increment;
Auto_increment is the automatic number
Original article address
Http://asp3000.blog.163.com/blog/static/8806120620091017103238664/
MySQL paging Query
Use query statements
Select * from table
.....
Limit a, B
A and B indicate records from A to B.
For example:
The limit 1,100
The limit 101,200
...
You only need to change the values of A and B in the query statement to obtain the set returned by different pages.
The total number of retrieved records is
Select count (*) from table .....
On the page, you only need to get the total number and divide it by the page size you want to calculate the total number of pages. Then, you can set your, the two parameters B are passed to the backend for distribution.