How to use the paging function in the switch statement

Source: Internet
Author: User
How to use the paging function in the switch statement? I created a form & lt; form & nbsp; action & nbsp ;=& nbsp; "query. php "& nbsp; method & nbsp ;=& nbsp;" post "& nbsp; enctype & nb how to use the paging function in the switch statement?
I created a form.


On the query. php page, select the following structure:
Switch ($ _ POST ['query']) {

Case "name ":
Search for the database and display it here;
Case "address ":
Search for the database and display it here;
}

How can I find the database under [case "name"] and [case "address"] and add the paging function?
During paging, $ _ GET ['Page'] is required to pass the page number, but the query. php page also has the $ _ POST variable. how can this problem be solved? Please advise
------ Solution --------------------
You can write a function in query. php to pass the page number and search type as parameters to the function. The function searches for data on each page based on the search type and page number. It is then called after case or after $ _ GET. You can also write data search functions in other PHP files, include them, and call functions. $ _ POST does not affect $ _ GET. you must display the first page after posting. you can set the function parameter to the first page by default.

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.