php and mysql results display

Discussion in 'PHP' started by BoBByCooL, Feb 24, 2008.

  1. #1
    I am running the following code in a while loop to display results from the database.

    while($row = mysql_fetch_array($result, MYSQL_ASSOC))
    {
    
    echo "<tr>\n" .
    "<td>{$row['id']}</td>\n" .
    "<td>{$row['proxyurl']}</td>\n" .
    "<td>{$row['date']}</td>\n" .
    "<td>{$row['ip']}</td>\n" .
    "<td>{$row['url']}</td>\n" .
    "</tr>\n";
    } 
    PHP:
    I would love to be able to display only like the first 50 results and then have a link that says NEXT 50 (or something like that) to display the next results in line.

    The SQL query I'm using is:

    $query = "SELECT * FROM log WHERE proxyurl = '$proxyurl'";
    Code (markup):
    Any ideas?

    THanks
     
    BoBByCooL, Feb 24, 2008 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Google for "PHP Pagination". There are a lot of tutorials online.
     
    nico_swd, Feb 24, 2008 IP
    BoBByCooL likes this.
  3. BoBByCooL

    BoBByCooL Peon

    Messages:
    335
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks a bunch. i've found some tutorials. might take me a while to get it figured out but i'll give it a shot.
     
    BoBByCooL, Feb 24, 2008 IP