Archive for the ‘Uncategorized’ Category


Increment mySQL field value

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

Share Through:
  • Print
  • Digg
  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter