Forum Moderators: coopster

Message Too Old, No Replies

print first 15 rows from database

         

yllai

2:20 am on Jul 12, 2004 (gmt 0)

10+ Year Member



i have 100 rows of data in my database, but when i query all yhe data from the databse and i want to display each 15 rows of data in a pharagarph. How can i do it. below is my code but all the record will be display out in one time but not 15 only.

That means...i have 100 rows of record in my database...when i query all the records, i want record 1 to 15 display in pharagraph A, record 16 to 30 display in pharagraph B, record 30 to 45 display in pharagraph C and so on.....any idea? Can it be done? any example?

Nutter

2:27 am on Jul 12, 2004 (gmt 0)

10+ Year Member



Try 'SELECT * FROM table LIMIT 0, 15' for first 15, 'SELECT * FROM table LIMIT 15, 15' for next 15, etc...

- Ryan

timster

7:53 pm on Jul 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just a note, Nutter's code looks like it's designed for MySQL -- if you're using a different SQL, just speak up.

Yep, sometimes it's easy to forget this isn't the MySQL forum...