[PHP] RE: [PHP-DB] Random Selecting from mySQL

2002-03-13 Thread Gurhan Ozen
Hi! Do you have a primary key field in the table? If yes, you can after displaying the first 10 records you can put the primary key values of those records in an array and have "primary_key_fiels NOT IN (array_values_seperated_by_commas)" in your quesry.. So when you display your first page with 1

[PHP] RE: [PHP-DB] Random Selecting from mySQL

2002-03-13 Thread Demitrious S. Kelly
Pass along a hidden form which documents exactly what rows have already been shown then you could use $seen=explode(':', $seen); to break it into an array... after that use a foreach to add a 'and id != '.$seen into the sql query for every element in $seen... thus not allowing duplicates on

[PHP] RE: [PHP-DB] Random Selecting from mySQL

2002-03-13 Thread Beau Lebens
could you perhaps do the select on the first page, then store the results in a session (array) and just load different indexed portions of the resultset each page? only problem there is that you wouldn't get any refreshed results while browsing those pages - but i don't know if this matters for y

[PHP] Re: [PHP-DB] Random Selecting from mySQL

2002-03-13 Thread Georgie Casey
yea, i know how to display 10 results per page, but that doesnt work when you want to do a ORDER BY rand() query. "Gurhan Ozen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > are you just looking for a way to display 10 results per page? If yes then > you can

[PHP] RE: [PHP-DB] Random Selecting from mySQL

2002-03-13 Thread Gurhan Ozen
are you just looking for a way to display 10 results per page? If yes then you can just use LIMIT to limit your result to 10 .. So, for the first page, you can do "SELECT LIMIT 1, 10;" and for the second page "SELECT ... LIMIT 11, 20" etc etc . You can sure use "ORDER BY" with "LIMIT" to t