Re: [PHP-DB] How to return records in _random_ order ???

2002-12-16 Thread tmb
Thanks Miles. Long story about why they need to be random. I'll give all the suggestions here a good review. Thanks everybody for the help. tmb "Miles Thompson" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I dunno - why does this topic pop up periodically

Re: [PHP-DB] How to return records in _random_ order ???

2002-12-16 Thread Peter Beckman
Try this; it only works on certain versions of mysql: select * from table order by rand(); Peter On Tue, 17 Dec 2002, Miles Thompson wrote: > I dunno - why does this topic pop up periodically. Anyway, here are two > suggestions: > > 1. Add a field to the table, called rand_order. Whenever you u

RE: [PHP-DB] How to return records in _random_ order ???

2002-12-16 Thread John W. Holmes
> I need to... > > 1 - Select a set of records from a db > > 2 - Return a list of one or two fields from the selected record set in > random order on a web page. > > Once I have my selected records & fields... say I end up with 20 records > after my select query... > > How can I return the sele

Re: [PHP-DB] How to return records in _random_ order ???

2002-12-16 Thread Miles Thompson
I dunno - why does this topic pop up periodically. Anyway, here are two suggestions: 1. Add a field to the table, called rand_order. Whenever you update the table insert a random number in it and when fetching records order by Rand_order. 2. Generate an array of 20 random numbers and use it to

[PHP-DB] How to return records in _random_ order ???

2002-12-16 Thread tmb
I need to... 1 - Select a set of records from a db 2 - Return a list of one or two fields from the selected record set in random order on a web page. Once I have my selected records & fields... say I end up with 20 records after my select query... How can I return the selected records in _rando