Page 1 of 1

select by range

Posted: Wed Mar 03, 2004 2:00 pm
by ol4pr0
Lets say i have a database with about 100 differant items.

How would i go about on doing this..

Code: Select all

//db connecting and all that

$result = mysql_query("SELECT first 10 items FROM items");

// some table..
echo "0>10 items";

$result = mysql_query("SELECT 10>20 items FROM items");
// second table
 "10>20 items";


// 3th
ect.....
Does this make any sence?

Posted: Wed Mar 03, 2004 2:10 pm
by andre_c
I think this is what you mean

Code: Select all

SELECT * FROM table LIMIT 1, 10  //start on first row, get ten rows
SELECT * FROM table LIMIT 11, 10   //start on eleventh row, get ten rows

Posted: Wed Mar 03, 2004 2:24 pm
by ol4pr0
Let me give that a try ;-)