Skip to content

Instantly share code, notes, and snippets.

@ursuleacv
Last active December 20, 2015 07:29
Show Gist options
  • Save ursuleacv/6093304 to your computer and use it in GitHub Desktop.
Save ursuleacv/6093304 to your computer and use it in GitHub Desktop.
PHP & MySQL best way to count page views for dynamic pages
INSERT INTO sites_views ( site_id, views) VALUES ( $site_id, 1)
ON DUPLICATE KEY UPDATE views=views+1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment