Re: display query results at random
| From: | CC Zona | Date: | Wed, 26 Sep 2001 03:58:57 +0000 |
| Subject: | Re: display query results at random | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-68811@lists.php.net to get a copy of this message | ||
In article <NDBBKBIHLCDMDICHLDKGEECMCHAA.matt@adplusonline.com>,
matt@adplusonline.com (Matthew Delmarter) wrote:
> Let's say I "select * from table" (using mysql_fetch_object) and get 5
> results. I want to display the 5 results in different / random places
> on the page.
>
> Place 1 - show details for record 3
> Place 2 - show details for record 1
> Place 5 - show details for record 5
select * from table order by rand() limit 3
See the manual at myql.com for more info on the "rand()" function and
"limit" keyword.
--
CC