Re: [PHP] random selection from each subfolder

2006-12-21 Thread chris smith
On 12/22/06, Steven Macintyre <[EMAIL PROTECTED]> wrote: Ok ... previous problem sorted ... now onto the next ... The client wants the following; A scroll bar with 3 random thumbs from each subdirectory in the /images/ folder I was thinking ... Going into each folder, getting files, pushing i

Re: [PHP] Random selection

2003-08-23 Thread Jim Lucas
Try this: SELECT name FROM table GROUP BY name ORDER BY RAND() LIMIT 3 This will group together all the names and then choose from a list that has only unique names and then return 3 at random. Jim Lucas - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Satur

Re: [PHP] Random selection

2003-08-23 Thread fkeessen
Hi, Thanks for the answer.. I'm open for faster ways!!! >BTW, if a value appears multiple times in a database column then your >database may be a good candidate for normalisation. Problem i'm selecting some holidays out of an database but I want to avoid that there are holiday's presented from

Re: [PHP] Random selection

2003-08-23 Thread Binay Agarwal
Hi You can use "select distinct names from table_name order by rand() limit 3". Hope this helps and let me know. cheers Binay - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, August 23, 2003 6:36 PM Subject: [PHP] Random selection > Hi, > > Can yo

Re: [PHP] Random selection

2003-08-23 Thread David Otton
On Sat, 23 Aug 2003 15:06:32 +0200 (CEST), you wrote: >In my mysql db i have a colum called names; > >In names their are: > >Frank >Frank >Bob >Alice >Bob >Alice >Jim >Alice >Frank > >I want to make a random selection (max 3 value's for example).. Only it may not >produce two times the same name.