I figured it out. I used ListGetAt. For some reason my brain doesn't want to give me the answer until I hit the send button. :)
Phil -----Original Message----- From: Phillip Perry [mailto:[EMAIL PROTECTED] Sent: Sunday, October 24, 2004 12:35 AM To: CF-Talk Subject: The final stretch... OK so I thought I had this thing licked but now its messed up again. I took out the date thing becuase its not that important anymore. I added 2 fields to my imagelist table called count and clicks. Everything was working fine when i had 4 records to look up. When I deleted the 4 test records from the database and inserted 1 new record, the image doesnt show up at all. I put 2 records in the db and neither of them show up. Can anyone see whats wrong with it? <cfquery datasource="#mydbname#" NAME="GetInfo"> SELECT * FROM ImageList </cfquery> <cfset MyImageList = "#ValueList(GetInfo.ImageID)#"/> <cfset MaxListLen = #ListLen(MyImageList)#> <cfset ListRandImage = randRange(1, maxlistlen)/> <cfquery datasource="#mydbname#" NAME="GetInfo2"> SELECT * FROM ImageList WHERE ImageID = #ListRandImage# </cfquery> <cfoutput query="GetInfo2"> <A HREF="process_path.cfm?LID=#LinkText#&IID=#ListRandImage#" TARGET="_blank"><img src="../#ImageSource#" alt="#AltText#" WIDTH="#ImageWidth#" HEIGHT="#ImageHeight#" BORDER="0"></A> </cfoutput> <cfdump VAR="#Variables#"> <cfquery datasource="#mydbname#" name="pageviews"> UPDATE ImageList SET ImageList.Count = (ImageList.Count + 1) WHERE ImageID = #ListRandImage# </cfquery> Thanks, Phil ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF community. http://www.houseoffusion.com/banners/view.cfm?bannerid=37 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182441 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54