MySQL Forums
Forum List  »  PHP

Concept Help / Newbie
Posted by: Tim Whitaker
Date: September 18, 2016 09:13AM

I am currently building a commercial website and am also relatively a noob to programming and PHP (although not completely concept illiterate as I did basic, Fortran, etc. back in college 20 years ago).

I am having trouble wrapping my head around something regarding using forms to filter data on multiple criteria while simultaneously utilizing pagination give the amount of data coming back.

To keep things simple, I have a basic webpage that accesses my MySQL database and pulls back a subset of data when the page is loaded. Since the data can be large, I have built a pagination routine that breaks the data at 20 records each. Everything works great.

However, I want to allow the end-user to further filter the data so I added a form at the top with option pulldows in which any combination of the 4 pulldowns is selected, I am dynamically building the SQL select statement based on those pulldowns. When the end-user clicks SUBMIT, it works fine.

However, that filtered data may ALSO have many pages of returns... so I want to utilize pagination on that filtered datga as well. But I am struggling conceptually as to how to program that.

If it were only one page of results, building that dynamic query would be enough because the end-user would only click submit one time and no pagination would be needed. But each time a pagination link is clicked (no longer clicking the submit button), the LIMIT in my query needs to maintain the filtered variables BUT ALSO keep those filters in place in my SQL statement that the user selected on the initial submit.

Any help guiding a newbie is greatly appreciated.

Thanks,
Tim

Options: ReplyQuote


Subject
Written By
Posted
Concept Help / Newbie
September 18, 2016 09:13AM
September 18, 2016 09:36AM
September 18, 2016 01:38PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.