title: Best Way To Track Page Views and store in MySQL
body: <p>I am currently developing an article driven site and would like to know the best way to track page hits so I can display something along the lines of "Most Viewed" or "Most Popular Articles". I display my articles through a $_GET on a single PHP page (e.g article.php?id=2). I read somewhere that an INSERT INTO was the way to go and I tried to do:</p>
  
  <pre><code>$page_views = $conn-&gt;query("INSERT INTO blog_posts (views) VALUES (views = views+1");
  </code></pre>
  
  <p>Alas, this did not work.</p>
  
  <p>In summary I want to be able to:</p>
  
  <ul>
  <li>Add 1 to the number of page views on an specific id for each time someone lands on the page (e.g articles.php?id=3) not just articles.php</li>
  </ul>
  
  <p>Thanks in advance.
  (Sorry if I haven't made this clear enough. If you want anything clarifying just ask.)</p>