Paging for php + mysql write

Source: Internet
Author: User
For example, in www.baidu.com? Id = 20 how do I write paging in this page? Id = 20. Why can't the page 2 3 4 be taken? Parameter... What should I do?


Reply to discussion (solution)

Let's talk about the meaning of id = 20 first.

The page number and id are not a value.
It works like this: www.baidu.com? Id = 20 & page = 1 // 2, 3, 4, 5 and other numbers.

Www.baidu.com? Id = 20 & page = 1 How do I get the page? How do I obtain the id? ,

What does your ID mean by page by ID field? If it is based on ID, then id = 20 your ID is not unique? Can one id = 20 correspond to multiple records? If there is only one record, why is it paging?

Www.baidu.com? Id = 20 & page = 1 How do I get the page? How do I obtain the id? ,
Let's read the basic php syntax first. this won't happen, so I'm speechless !!!!!

Www.baidu.com? Id = 20 & page = 1 How do I get the page? How do I obtain the id? ,

Www.baidu.com? Id = 20 & page = 1 How do I get the page? How do I obtain the id? ,

Www.baidu.com? Id = 20 & page = 1 How do I get the page? How do I obtain the id? ,

Well, this is a basic knowledge of PHP parameters.

We recommend that you take a look at PHP's knowledge of obtaining parameters. There are two methods for obtaining parameters in PHP: $ _ GET ['parameter name']. the other is the $ _ POST ['parameter name'] for form submission, and the other is for both get submission and post submission.

Print_r ($ _ GET );


Www.baidu.com? Id = 20 is $ _ GET ['id']. you can GET 20.

Www.baidu.com? Id = 20 & page = 1 $ _ GET ['id'] can GET 20 ?? $ _ GET ['Page'] can GET 1 ???

Really speechless to you, do you have no hands? Cannot test by yourself? Are you sure you want to ask? Cannot the results obtained by yourself prove more?

Related Article

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.