Results 1 to 3 of 3
  1. #1
    ABW Ambassador Steveinid's Avatar
    Join Date
    January 18th, 2005
    Posts
    827
    I have successfully set up a website using PHP and MySQL. I simply add links to a browswer based form and it loads it directly into my database and then the website pulls it off when visited. Very neat since I have never done it beore. I now have a small problem. I have too many items on a page. I have a very thick book called PHP and MySQL Web Development by Welling/Thomson. It has a lot of stuff in it. What I want to do is to tell my site to start a new page after displaying 20 items. I would simply look it up but I don't know what that function/operation (whatever) is called. Any help would be appreciated.

    Thanks

    "Bueller...? Bueller...?"

  2. #2
    ABW Ambassador sjangro's Avatar
    Join Date
    January 18th, 2005
    Location
    Boston
    Posts
    1,529
    In MySql, you can use LIMIT.

    select * from table
    LIMIT 0,20

    (Get 20 rows starting at #0).

    Page 2:

    select * from table
    LIMIT 20,20

    Generically:

    select * from table
    LIMIT ($pagenum - 1) * $pagelength, $pagelength

    --
    scott@befree.com
    AOL/Yahoo: sjangro

  3. #3
    ABW Ambassador Steveinid's Avatar
    Join Date
    January 18th, 2005
    Posts
    827
    Thanks for the help. I'll give it a try.

    "Bueller...? Bueller...?"

  4. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. How is this programmed? (Or what is it called)
    By Hardaka in forum Programming / Datafeeds / Tools
    Replies: 28
    Last Post: March 16th, 2008, 01:21 AM

Posting Permissions

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