Re: Re: random record mysql
| From: | Jason Wong | Date: | Sat, 26 Apr 2003 18:43:13 +0000 |
| Subject: | Re: Re: random record mysql | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145369@lists.php.net to get a copy of this message | ||
On Saturday 26 April 2003 05:32, tbo wrote:
> For the life of me I cannot figure out how to get a random record to be
> displayed off a record set using mysql and php. I have seen examples of
You asked "how to get A random record" ...
> When using the following" SELECT * FROM banners ORDER BY RAND() LIMIT 1 " I
> still only receive the first row in that db table. Any ideas???
... LIMIT 1 will give you A random record. If you want more than one then
change the limit or omit it altogether.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Actresses will happen in the best regulated families.
-- Addison Mizner and Oliver Herford, "The Entirely
New Cynic's Calendar", 1905
*/