Pass along a hidden form which documents exactly what rows have already
been shown

<input type="hidden" name="seen" value="1:4:3:9:10:5:27">

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 a per
visit basis...

-----Original Message-----
From: Georgie Casey [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, March 13, 2002 4:11 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Random Selecting from mySQL

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 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 to sort the results for
a
> given criteria ..
>
> Gurhan
>
>
> -----Original Message-----
> From: Georgie Casey [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 13, 2002 2:00 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP-DB] Random Selecting from mySQL
>
>
> I know how to use the "ORDER BY rand()" command on the end of queries
to
> randomize selection, but that's no good when you want to only display
10
> results per page. The next page the user chooses, randomizes again and
could
> show duplicate fields and not at all show other fields.
>
> Does anyone know a way round this?
>
> --
> Regards,
> Georgie Casey
> [EMAIL PROTECTED]
>
> ***************************
> http://www.filmfind.tv
> Ireland's Online Film Production Directory
> ***************************
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to