Reteriving set of records from MySql using PHP - Help Me

Discussion in 'PHP' started by kks_krishna, May 12, 2007.

  1. #1
    HI,

    I am implementing pagination in my site. I want to display 10 rows each page. how can a reterive only 10 rows from MySql. what is function to use from PHP.
    Please help me.
     
    kks_krishna, May 12, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    
    SELECT * FROM yourtable LIMIT 0, 10
    
    Code (sql):
     
    nico_swd, May 12, 2007 IP
  3. CodyRo

    CodyRo Peon

    Messages:
    365
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #3
    CodyRo, May 12, 2007 IP
  4. greenrob

    greenrob Peon

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    For the 1st 10,

    SELECT * FROM yourtable LIMIT 0, 10

    For the 2nd 10
    SELECT * FROM yourtable LIMIT 10, 10

    etc etc ...
     
    greenrob, May 12, 2007 IP