This has always been one of those "there's got to be a way to do this" things with me. I asked about it on another list and someone showed me that in MySQL 4.1 you can do the following:
INSERT INTO dailycounters (trackingdate, itemid, count) VALUES (<today>, <somerecordid>, 1) ON DUPLICATE KEY UPDATE count = count + 1; ----- Original Message ----- From: "Howie Hamlin" <[EMAIL PROTECTED]> To: "CF-Talk" <cf-talk@houseoffusion.com> Sent: Wednesday, February 02, 2005 3:13 PM Subject: Re: SQL Q > The stats are not that critical but I guess I could dump the code as is > and redo it to do a select first. The other thing that I was > considering was keeping accumulators in application vars and updating > the database hourly but I was concerned that we'd lose some data if cf > were restarted. > > Thanks for all the suggestions. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192834 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