View RSS Feed

Recent Blogs Posts

  1. Pagination Tutorial - Part 4

    by on December 13th, 2008 at 11:25 AM
    I have another web site that can access a database that contains 2,100 records of past crew members of my old Navy ship. I wanted to make it convenient to search for personnel who were aboard the ship during any particular year, and I also wanted to be able to search in alphabetic groups. This isn’t the same kind of pagination we’ve been discussing, but it’s another way to display data conveniently for the viewer. Visit usselectra.org and click on the Database button on the left, then select ...
    Categories
    PHP , MySQL
  2. Pagination Tutorial - Part 3

    by on December 13th, 2008 at 11:25 AM
    More complicated pagination:
    That’s pretty much it, for simple pagination. Sometimes you may want added features, such as allowing the viewer to sort the results they see. I have a poetry web site that illustrates such a feature. Take a look at The Poa Tree - Home and click on the Go To The Poems button in the upper right. The script for that page follows:

    PHP Code:
    <?php
    session_start
    ();

    if (isset(
    $_SESSION['login'])) $login $_SESSION['login'];
    if (isset(
    $_GET['sort']))
    ...
    Categories
    PHP , MySQL
  3. Pagination Tutorial - Part 2

    by on December 13th, 2008 at 11:25 AM
    Simple Example:
    This is pretty much the simplest example of a pagination script:

    PHP Code:
    <?php
    // set the page number – if it is not passed in the URL, set it to page 1
    if(isset($_GET['pg'])) {
        
    $pg=mysql_real_escape_string($_GET['pg']);
    } else {
        
    $pg=1;
    }
    if(
    $pg 1$pg=1;

    $perpage=10;  // <-- set to how many items you want on a page
    $startrec=($pg 1) * $perpage;  // <-- starting record for
    ...

    Updated December 14th, 2008 at 02:06 AM by don94403 (Changed method of determining number of records.)

    Tags: pagination
    Categories
    PHP , MySQL
  4. Pagination Tutorial - Part 1

    by on December 13th, 2008 at 11:24 AM
    A frequent subject of questions in any PHP/MySQL forum is how to display some number of database records on a web page, letting the viewer "page" to the next group, or return to a previous group. This is often called pagination and there are many articles available describing how to write the code to do it. Not wishing to be left out of the ranks of authors who write about it, I have now written my version of a Pagination Tutorial, with example code. I hope that it will be useful to someone. ...

    Updated December 13th, 2008 at 12:57 PM by don94403

    Tags: pagination
    Categories
    PHP , MySQL

SEO by vBSEO