Feed on
Posts
Comments

I wanted to make a small addition to the pagination class talked about at http://www.catchmyfame.com/2007/07/28/finally-the-simple-pagination-class/. I added another example which uses a basic form at http://www.catchmyfame.com/paginator/example-form.php. This is very similar to the first example (http://www.catchmyfame.com/paginator/example.php) where the query is hard coded. This new example is meant to show how the pagination class can be used with forms where the data determines the query. In this case, the pull down menu for a continent selection determines the query. Note that the pagination class works fine with both GET and POST requests.

4 Responses to “Simple Pagination Class Revisited”

  1. me alfi says:

    can u send me ur example.php and example-form.php file plz, hard to me to make the pagination work, plz reply me bos, ASAP.. :D

  2. Chris says:

    Your contact link isn’t working. I wanted to ask about using this in a small web application I’d like to sell.

  3. admin says:

    Ug, stupid WordPress update. Fixed.

  4. Michael says:

    Like a lot of people on here, I’m new to OOP techniques. When using your class, I get the page numbers to display correctly, but I get several undefined index errors for ipp and page. Also, when I click one of the page numbers, I get the following fatal error:
    Database query failed: Table ‘rcservice.pages’ doesn’t exist
    I’m not trying to query that non existent table anywhere from my own code and my queries seem to run and display fine even showing the pagination links. I just can’t use the links without getting the error.
    Any help would be greatly appreciated.

    Results Display

    items_total = $number_of_results;
    $pages->mid_range = 9;
    $pages->paginate();
    echo $pages->display_pages();
    //$page_limit = $pages->limit;
    $query = “SELECT id, newCustomerNumber, name FROM cust_detail ” . $pages->limit;
    $result_set = mysql_query($query, $connection);
    ?>

    Number of Results

    Customer NumberCustomer Name

    <?php
    while ($results=mysql_fetch_array($result_set)){

    echo "” . $results['newCustomerNumber'] . ““;
    echo “” . $results['name'] . “”;

    if (isset($_GET['b']) AND ($results['newCustomerNumber'] == $_GET['b'])){

    $equip_query = “SELECT id, newCustomerNumber, model, richCoastSerial “;
    $equip_query .= “FROM equip_location “;
    $equip_query .= “WHERE newCustomerNumber = ” . $results['newCustomerNumber'] . ” “;
    $equip_set = mysql_query($equip_query, $connection);

    echo ” Equipment Detail “;
    echo “ModelRich Coast Serial Number”;
    while ($equipment=mysql_fetch_array($equip_set)){
    echo “” . $equipment['model'] . “”;
    echo “” . $equipment['richCoastSerial'] . “”;

    }
    echo ” “;
    }

    }
    echo “”;

    ?>

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>