NotOneBit Blog

Get started today on your next web project with NotOneBit
We've been doing web development before you were born *

Simple Pagination Class Revisited

I wanted to make a small addition to the pagination class talked about at I added another example which uses a basic form at This is very similar to the first example ( 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.

Posted in PHP

4 thoughts on “Simple Pagination Class Revisited

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

  2. 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;
    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

    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

Your email address will not be published. Required fields are marked *

%d bloggers like this: