Re: How to randomly select data in a field. Please help newbie.

From: Date: Wed, 02 May 2001 04:30:45 +0000
Subject: Re: How to randomly select data in a field. Please help newbie.
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-9028@lists.php.net to get a copy of this message
Hi, I'm newbie from Indonesia. Your query has helped me to create random text using PHP and MySQL. Could you please give me an example script for random text, the text changes in every 24 hours/every 7 o'clock in the morning not after "refresh/reload". Thanks for your help. Max Indonesia ----- Original Message ----- From: "Johannes Janson" <johannes.janson@gmx.de> To: <php-db@lists.php.net> Sent: Monday, April 30, 2001 6:56 PM Subject: Re: [PHP-DB] How to randomly select data in a field. Please help newbie. > Hi, > > you could do the random selection in MysSQL if you use it > using a query like this. > SELECT FieldWithURL FROM YourTable ORDER BY RAND() LIMIT 0,1; > This will give you a random field. If you want more fields you have to > set different values for the limit. Like LIMIT 0,5 for the first 5 row. > Just if you don't know the syntax of LIMIT: limit 'StartingPoint', > 'NumberOfRows' > > hope it helps > Johannes > > ""Greg K"" <gkelly455@ameritech.net> schrieb im Newsbeitrag > news:9cfe9n$ggd$1@toye.p.sourceforge.net... > > Can someone explain to me the best way to randomly select data from field > > that consist of urls. The fields consist urls that are images of people. > I > > believe I have to setup that field as a array and turn it into a interger. > > But I have no experience doing this can someone sort of give me a example > on > > how I would do this . > > > > Thank you .. > > > > Your Help would be well appreciate it .. > > > > > > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > For additional commands, e-mail: php-db-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#9028) next »