CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2005
    Posts
    73

    Help with pagination!!!!

    Hi all!

    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.

    What am I missing here?
    Attached Files Attached Files

  2. #2
    Join Date
    May 2012
    Location
    Bonn, Germany
    Posts
    43

    Re: Help with pagination!!!!

    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.

  3. #3
    Join Date
    May 2002
    Posts
    10,943

    Re: Help with pagination!!!!

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured