Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Location
    Central Scotland
    Posts
    243

    Question next and previous setup problem

    I've got a script that contains 190 items, I want to display 30 per page and use < PREVIOUS 2 | 3 | 4 NEXT >. I've tried this myself (see below) using a script from spoono.com. I should have known better as nothing I try form spoono ever works, and everyone else seems to have the same problems according to their discussion board.

    Here is what I have..

    PHP Code:
      <?php

            
    if(!isset($_GET['act']) || $_GET['act'] != 'play'){
                echo 
    $sys->makeGamesList();
            } else {
                if(isset(
    $_GET['id'])){
                    echo 
    $sys->makeGameHtml($_GET['id'], $_GET['cid']);
                } else {
                    echo 
    '<div style="margin: 30px;">
                    <strong>Error: </strong>Invalid Input<br /><br />
                    <a href="'
    .$_SERVER['PHP_SELF'].'">Click here to return Home</a>
                    </div>'
    ;
                }
            }
            
            
    //initialize the start to 0
    if(!$rowstart$rowstart=2;

    //mysql queries
    $result mysql_query("select * from games limit $rowstart,30");
    $result2 mysql_query("select * from games");

    //find the number of total rows in the shoutbox total
    $numrows mysql_num_rows($result2);

    //put all the code here for running the script itself using $result in the while loop

    //put where you want the next prev to appear
    if ($rowstart $numrows
    {
       echo 
    "<A HREF=\"$php_self?rowstart=$rowstart-30\">< Next Page </A>";
    }

    if(
    $rowstart+30<$numrows
    {
       echo 
    "<A HREF=\"$php_self?rowstart=$rowstart+30\"> Next Page </A>";


            
    ?>

    I'd be grateful if someone could point me in the right direction.

    I'm available on MSN: [email protected]
    AIM: jester79lm
    ICQ: 168963749

    So if you need to ask me questions, I'm usually available when not sleeping.
    WKD Banners | Make the most of your advertising!
    Designing banners since 2004 | Visit our Website www.wkdbanners.com

  2. #2
    Join Date
    Mar 2004
    Location
    USA
    Posts
    4,342
    This tutorial well help you out:

    http://www.phptricks.com/?view=&lesson_id=25&section=2

    Peace,
    Testing 1.. Testing 1..2.. Testing 1..2..3...

  3. #3
    Join Date
    May 2004
    Location
    Central Scotland
    Posts
    243
    Nope, it didn't help. I am not that great with php, so I'd probably need someone to supply me with the code already written. =\
    WKD Banners | Make the most of your advertising!
    Designing banners since 2004 | Visit our Website www.wkdbanners.com

Posting Permissions

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