Re: FN-FORUM: Problems trying to sort query results randomly, whilst splitting over several pages
date posted 9th August 2007 11:23
On 9 Aug 2007, at 11:40 am, Duncan Glendinning wrote:
>
> Good Morning all!
>
> This is really puzzling me... I have some search results yielded from
> my MySQL query. Because there are so many, I am having to split them
> into a number of pages. This is working fine, passing the page a
> PageNum variable in the URL which then re-queries the database using
> an offset.
> The problem is that I would ideally like to sort the results randomly.
> If I do this, then the same results could come up, as on every
> subsequent page the query is re-run, randomly.
> As I can't think of a simple way of passing the query result from one
> page to another, I can't see a way around this.
>
> Any ideas?
>
> Many thanks,
>
> Duncan
Could you store the randomly-sorted results in a temporary table and
request that in page-by-page batches?
Ian.
--
Ian Piper
Tellura Information Services - the web, document and information people
http://www.tellura.co.uk/
01926 811574 | 07973 156616
skype: ianmpiper
Key Minder : easy to use, inexpensive, industrial strength password
protection : http://www.tellura.co.uk/keyminder/
--