This is a multi-part message in MIME format.
--=_NextPart_000_00D4_01C032B7.F448F580
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
RE: random by day
Or a bit shorter, taking advantage of the ability to directly access a query
row.
cf
Why not this?
cfquery name="getrecords" datasource="MINE"
SELECT *
FROM QUOTES
/cfquery
cfset RandNum = #RandRange(1,getrecords.RecordCount)#
CFLOOP QUERY="getrecords"
CFIF CurrentRow EQ #RandNum#
CFOUTPUT
Random Record No =
Why not this?
cfquery name="getrecords" datasource="MINE"
SELECT *
FROM QUOTES
/cfquery
cfset RandNum = #RandRange(1,getrecords.RecordCount)#
CFLOOP QUERY="getrecords"
CFIF CurrentRow EQ #RandNum#
CFOUTPUT
Random Record No =
From: [EMAIL PROTECTED]
Last week there was a discussion about pulling a random quote from a database.
I would like to pull a record from a database once a week, lets say every
sunday. Kind of like the quote of the week. Whats the best way to do that?
The page that displays the quote
Juncker [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 09, 2000 5:08 PM
To: CF-Talk
Subject: RE: random by day
Why not this?
cfquery name="getrecords" datasource="MINE"
SELECT *
FROM QUOTES
/cfquery
cfset RandNum = #RandRange(1,getrecords.RecordCount)#
5 matches
Mail list logo