Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Posts
    3

    Unanswered: Php + Microsoft access

    Hi,
    Please help me how to display Paging results using microsoft acess + Php.

  2. #2
    Join Date
    Jun 2003
    Posts
    20
    do you mean displaying 25 records per page?

    i have seen in access, people doing a while loop for all records, but only displaying a certain 25 records

    while not rs.eof

    if i < 51 and i > 25
    response.write rs("fieldname")

    end if

    wend

    for 51 and 26 you sub variables that you pass from page to page.

    Hope this helps!

  3. #3
    Join Date
    Jun 2003
    Posts
    20
    Oops! I gave you vbscript pseudo code.

    basically, in PHP it is the same idea. You want to make two variables that hold the number of rows that should be displayed.


    already you should be able to do this, which displays all records from your query
    Code:
    while (there are records) { 
        echo $row['field'];
    
    }
    now do this
    Code:
    while (there are records) {
       $i++;
    
       if ($i > 20 || $i < 41)
        echo $row['field'];
    
    }
    this should only display records 21 thru 40.

    Once you have that working, make 20 and 41 variables, and pass them from page to page, so that on the next page they are 30 and 51.

    makes sense?

  4. #4
    Join Date
    Jul 2003
    Location
    Jersey
    Posts
    11

    Re: Php + Microsoft access

    Originally posted by balu116
    Hi,
    Please help me how to display Paging results using microsoft acess + Php.
    http://www.phpfreaks.com/tutorials/43/0.php (reuse)

Posting Permissions

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