Seona, Don't go and waste resources and let the RDBMS handle this for you, it's a LOT faster. I mean, why would you want to get x records across the network and then pull one or two random records form it? What a waste..
Taco Fleur Tell me and I will forget Show me and I will remember Teach me and I will learn > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Peter Tilbrook > Sent: Sunday, 11 July 2004 11:40 AM > To: CFAussie Mailing List > Subject: [cfaussie] RE: Outputting a random result from a query > > > Seona, have a look here for inspiration - and many other turotials: > http://tutorial164.easycfm.com/ -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Seona Bellamy Sent: Sunday, 11 July 2004 11:21 AM To: CFAussie Mailing List Subject: [cfaussie] Outputting a random result from a query Hi guys, Well, I fixed my other problems after a bit of fiddling (the coding ones, anyway...). This new one is just a logic thing which I'm having trouble figuring out. I have a query that looks through the Product table in the database and finds all the products that are listed as "on special". What I want to do is select a random item from the recordset returned by this query and output it into the sidebar of the site so that every time you visit the page you see a random product that is on special. How do I go about doing this? Do I have to apply some randomisation logic to the query, or is it something done post-query? And what is the logic I need to apply? I've gone around in circles on this one and I just can't work it out. Thanks, Seona. --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/ --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/ --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
