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.