WEB PHP Help

Discussion in 'OT Technology' started by k2737, Oct 16, 2008.

  1. k2737

    k2737 Active Member

    Joined:
    Nov 29, 2004
    Messages:
    3,324
    Likes Received:
    0
    Location:
    Ft Lauderdale
    I want to display the contents of a database and have no trouble doing that but I need a nice way to navigate through all of the records in the database. There are about 1,000 records now so I want to have a navigation menu similar to OT's page menu. So something like:

    1-25 26-50 etc

    And have each being a link to displaying those records. Do you guys know of a online tutorial or even what something like that would be called to aid in my googling? :o
     
  2. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,486
    Likes Received:
    69
    Location:
    Sparkopolis
    this would be so easy in Drupal :o
     
  3. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,486
    Likes Received:
    69
    Location:
    Sparkopolis
    if the rows have index/id fields, you could pass 2 variables in a query string.. x variable is what row to start at.. y variable is how many to show per page.. then the php just searches for the starting x index and grabs y rows

    http://www.w3schools.com/php/php_mysql_select.asp

    build the links at the bottom of the page using the same variables
     
  4. k2737

    k2737 Active Member

    Joined:
    Nov 29, 2004
    Messages:
    3,324
    Likes Received:
    0
    Location:
    Ft Lauderdale
    Unfortunately there isn't any type of ID or index for each record so they have to be counted. I found this link and I think it will help me do what I want...

    http://www.onlamp.com/pub/a/php/2000/11/02/next_previous.html?page=2

    The problem I am having now is when I do the initial count something is timing out and it isn't finishing the query. The database is on an older machine and there are a ton of files stored in the database so I think I am going to have to figure out how to clean that up and fix the timeout issue first. :o
     

Share This Page