First record does not show in pagination script

Posted by whitstone86 on Stack Overflow See other posts from Stack Overflow or by whitstone86
Published on 2010-05-28T18:46:06Z Indexed on 2010/05/28 18:52 UTC
Read the original article Hit count: 227

Filed under:
|
|

This is my pagination script which extracts info for my TV guide project that I am working on. Currently I've been experimenting with different PHP/MySQL before it becomes a production site.

This is my current script:

    <?php
/***********************************
 * PhpMyCoder Paginator            *
 * Created By PhpMyCoder           *
 * 2010 PhpMyCoder                 *
 * ------------------------------- *
 * You may use this code as long   *
 * as this notice stays intact and *
 * the proper credit is given to   *
 * the author.                     *
 ***********************************/
// set the default timezone to use. Available since PHP 5.1
putenv("TZ=US/Eastern")
?> 
    <head>
        <title> Pagination Test - Created By PhpMyCoder</title>
        <style type="text/css">
            #nav { font: normal 13px/14px Arial, Helvetica, sans-serif; margin: 2px 0; }
            #nav a { background: #EEE; border: 1px solid #DDD; color: #000080; padding: 1px 7px; text-decoration: none; }
            #nav strong { background: #000080; border: 1px solid #DDD; color: #FFF; font-weight: normal; padding: 1px 7px; }
            #nav span { background: #FFF; border: 1px solid #DDD; color: #999; padding: 1px 7px; }
        </style>
    </head>
        <?php
            //Require the file that contains the required classes
            include("pmcPagination.php");

            //PhpMyCoder Paginator
            $paginator = new pmcPagination(20, "page");

            //Connect to the database
            mysql_connect("localhost","root","PASSWORD");
            //Select DB
            mysql_select_db("mytvguide");

            //Select only results for today and future
            $result = mysql_query("SELECT programme, channel, airdate, expiration, episode, setreminder FROM lagunabeach where expiration >= now() order by airdate, 3 ASC LIMIT 0, 100;");
            //You can also add reuslts to paginate here
            mysql_data_seek($queryresult,0) ; while($row = mysql_fetch_array($result))
            {
                $paginator->add(new paginationData($row['programme'],
                                                   $row['channel'],
                                                   $row['airdate'],
                                                   $row['expiration'],
                                                   $row['episode'],
                                                   $row['setreminder']));
            }
        ?>
        <?php
            //Show the paginated results
            $paginator->paginate ();
        ?><? include("pca-footer1.php"); ?>
        <?php
            //Show the navigation
            $paginator->navigation();                       
        ?>

Despite me having two records for the programmes airing today, it only shows records from the second one onwards - the programme that airs at 8:35pm UK time GMT does not show, but the later 11:25pm UK time GMT one does show.

How should I fix this? Above is my code if that is of any use!

Thanks

© Stack Overflow or respective owner

Related posts about php

Related posts about tsql