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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Sams Teach Yourself Regular Expressions in 10 Minutes by Ben Forta
http://www.houseoffusion.com/banners/view.cfm?bannerid=40
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182438
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54