January 17th, 2011
Here is a single query that will allow you to increment a field value in an existing database record or insert a new record if the row does not exist. The table you use must have a unique ID defined.
INSERT INTO web_count (name, counter) VALUES (‘test.htm’, 1) ON duplicate KEY UPDATE counter = counter + 1

