All,
I'm doing a query and randomly displaying images from within each record
but records have been removed so I don't have sequential id values.
PROBLEM:
When I run this code sometime I get images, sometimes I get nothing.
Should I be running a different random'izer? 8-) Any ideas?
CODE:
#lgthbimg#/cfoutput width=262
height=231 border=0
...
Ben Nadel
www.bennadel.com
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 23, 2006 12:14 PM
To: CF-Talk
Subject: CFQUERY of non-swequential primary key ids
All,
I'm
/udf.cfm?id=524
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 23, 2006 12:14 PM
To: CF-Talk
Subject: CFQUERY of non-swequential primary key ids
All,
I'm doing a query and randomly displaying images from within each record
but records have been
You could query the table and get a list of the available IDs.
Generate a random number between 1 and listlen() and then using
ListGetAt() you can get that random ID and then query the DB again to
pull back that record.
On 8/23/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
All,
I'm doing a
Subject: RE: CFQUERY of non-swequential primary key ids
How very inefficient. How about something like this:
cfquery name=get_vid_ids datasource=#datasource# SELECT vidwee_id FROM
vidweek /cfquery
cfset idList=valueList(get_vid_ids.vidwee_id)
cfset idPosition=randRange(1,listLen(idList
5 matches
Mail list logo