[ic] Random display of search result??

Bill Carr interchange-users@icdevgroup.org
Fri Jun 14 13:18:04 2002


On Fri, 2002-06-14 at 12:47, Jim Toro wrote:
> 
> Is there a way to do a random display of items once found in a search?.
> 
> 
> I have no problem with any kind of search and display in a results page,
> but a customer wants the items to display in random order after a search
> result occurs. I cant think of any easy way to do it.
> 
> Any ideas?. It would have to be a true random display each time even
> though the list of items are strict in that they match the search spec.
If you are using mysql (and others probably) this should work:
[query
   list=1
   sql=|SELECT * FROM products ORDER BY RAND() LIMIT 3|
]
[list]
	[sql-param title]<br>
[/list]
[/query]


-- 
Bill Carr
Worldwide Impact
bill@worldwideimpact.com
413-253-6700