Pagination and form tag issue

i have two .php files: trialform.php and trialaction.php

User chooses search terms using <select> tags on trialform.php, and then that information goes to trialaction.php that has mySQL $query=SELECT * ... which contains variables like $expression1 etc. (Depending on the user's choice).

It works fine. But I wanted to implement pagination from this source Now my query works only for the first pagination page, when I click on the second and third...it does not show any results. The problem is that the $query=SELECT * ... refers to trialform.php, and it does not exist after the user pressed "Submit".

Do I have to split my $_POST code section in a separate .php file in order to be able to use pagination and <form>?

Answers


this is often performed with parameters on subsequent pages passing updates to the page number (gets you the start parameter) and limit as can be seen here http://dev.sencha.com/deploy/ext-4.0.0/examples/grid/paging.html

and viewing the http headers in fiddler. for page 4 you get

GET /forum/topics-browse-remote.php?_dc=1368498808032&page=4&start=150&limit=50

and page 5 is

GET /forum/topics-browse-remote.php?_dc=1368498808032&page=5&start=200&limit=50

so subsequent pages (prior or next) know where to start. naturally the parameters are fed into the select statement such as select * from employee limit 200,50 # start,limit


Need Your Help

Em Dash and En Dash from MySQL Db with PHP

php mysql utf-8 dash

I'm trying out output a MySQL database field with PHP which contains em dash and en dash, but although the ROWs output, the values with these dashes do not.

Entity Framework IQueryable, with 2 queries

c# linq entity-framework iqueryable

I wanted to ask if there is a better way to achieve what I'm trying to do.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.