So, I have a website for a database which contains biological data (proteins). In this website, there is a text search page,
where the user can specify one or more search terms in order to get data from the database. The user can enter up to 5 search terms in each of the
available text boxes, as shown below in text_search.php
The retrieve_text.php page gets the data submitted by the user and fetches the results. Also, if the user clicks on 1 or more of the
checkboxes next to each record, the respective entries are downloaded as raw format archives.
However, because in some cases there were more than 200 results
I decided to implement pagination... I searched around and asked for help, and managed to get it as far as you see below.
My problem is that, although the state of the selected entries is maintained as the user browses from page to page, this is NOT the
case for the $wclause_sql part, which is actually the "WHERE" clause of the sql query. So I can only see the first page, and not the others...
I used sessions in order to keep track which records are selected by the user, so as when the user finally hits 'Retrieve'
he can get all the desired entries, but I cannot transfer the $wclause and therefore, in all other pages except page 1, the SQL query is empty, thus no
entries are shown.
I did not look at your code (probably nobody will, it's just too big).
But I would not store such things in a session! What if a user opens several tabs on your site?
The pagination should be done with GET parameters in my opinion.
ktsirig, you've already asked about pagination a few times here on CodeGuru. And, in one of them I gave you a fully functional example...using URL variables with GET. TomasRiker is 100% correct in that.
How exactly does this differ from those times?
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.