Re: How to randomly select data in a field. Please help newbie.
| From: | Johannes Janson | Date: | Mon, 30 Apr 2001 11:56:48 +0000 |
| Subject: | Re: How to randomly select data in a field. Please help newbie. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-8985@lists.php.net to get a copy of this message | ||
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
>