SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Perfect Pagination question regarding "targetpage"

    I have tried to implement this class with some success. The first page displays correctly, but subsequent pages do not. One of the variables in the class is a "targetpage". My site is set to have content pages display in a div on my "displayPage.php". These content pages are called from a database query. All information needed for the page display is included in this database (included pages, css, colors, etc. The resulting URL would be something like: "displayPage.php?id=2". How do I incorporate this into the Perfect Pagination class?

  2. #2
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, I have the same problem but then I found this other code and it seems to be working.
    I hope it can help.

    <?php
    $username="yourusername";
    $password="yourpassword";
    $database="yourdatabase";

    $dbh=mysql_connect(localhost,$username,$password) or die ('I cannot connect to the database because: ' . mysql_error());
    @mysql_select_db($database);


    $result = mysql_query("SELECT COUNT(*) AS total_entries FROM yourtable") or die(mysql_error());
    $row = mysql_fetch_row($result);


    $total_entries = $row[0];



    $entries_per_page = 10;


    if(isset($_GET['page_number'])) {
    $page_number = $_GET['page_number'];
    } else {
    $page_number = 1;
    }


Bookmarks

Posting Permissions

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