Pagination not working

Discussion in 'PHP' started by greenlizard, Jun 26, 2010.

  1. #1
    Hi,

    My pagination isn't working. Can someone provide a bare minimum, very simple example of how to set up pagination?

    Thanks!
     
    Last edited: Jun 26, 2010
    greenlizard, Jun 26, 2010 IP
  2. themullet

    themullet Member

    Messages:
    110
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #2
    
    $pg = 2;
    $numPerPg = 10;
    $qid = mysql_query("SELECT * FROM blah LIMIT ".(($pg-1)*$numPerPg).",$numPerPg");
    $num = mysql_num_rows($qid)
    
    if ($pg!=1) {
     echo "<a href=\"".($pg-1.)"\">prev</a>";
    }
    if (($num/$numPerPg)>$pg) {
     echo "<a href=\"".($pg+1.)"\">next</a>";
    }
    
    PHP:
     
    themullet, Jun 26, 2010 IP
  3. anoopsachari

    anoopsachari Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I have customized a php file for db-connectivity and pagination could mail you if u can drop me your mail id .
     
    anoopsachari, Jun 29, 2010 IP
  4. imperialDirectory

    imperialDirectory Peon

    Messages:
    395
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    imperialDirectory, Jun 29, 2010 IP