Joe's right, and you could really use one simple query to get it done like

<cfquery DATASOURCE="#mydbname#" NAME="UpdateData">
 UPDATE ImageData
 SET PageViews = PageViews + 1,
  ImageShowDate = GetDate()
 WHERE ImageId = #ListRandImage#
</cfquery>

The only disadvantage is that "ImageShowDate" overrides all previous image view date.  
And I don't know if the DBMS you're using support the GetDate() function.

Don

>Phillip,
>
>It looks like you're inserting a new row into the table each time, in
>which case it'd only go to two.  What I think you mean to do is update
>the row of the image returned by GetInfo3, in which case you'd want to
>use an UPDATE statement.  Try this:
>
>
><cfquery datasource="applewood" name="Getinfo3">
>SELECT *
>FROM ImageData
>WHERE ImageID = #ListRandImage#
></cfquery>
>
><cfquery DATASOURCE="#mydbname#" NAME="UpdateData">
>UPDATE ImageData
>SET PageViews = PageViews + 1,
>  ImageShowDate = GetDate()
>WHERE ImageId = #GetInfo3.ImageID#
></cfquery>
>
>Have a good weekend,
>
>Joe
>
>-- 
>For Tabs, Trees, and more, use the jComponents:
>http://clearsoftware.net/clear/?template=downloads.jComponents

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=35

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182461
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

Reply via email to