Unholy Prayer Posted March 6, 2007 Share Posted March 6, 2007 Another question about my forum software for my website. How would I make it so the integer of the "views" field of the threads table automatically increases for every time a user views that thread? Quote Link to comment Share on other sites More sharing options...
trq Posted March 6, 2007 Share Posted March 6, 2007 Run an update statement to update the increment the database field. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted March 6, 2007 Share Posted March 6, 2007 <?php //If they are viewing a thread if ($_GET['threadID']){ $threadID = $_GET['threadID']; //update views in database mysql_query("UPDATE threads SET views = views+1 WHERE threadID = '$threadID'"); } ?> Something along the lines of that... Quote Link to comment Share on other sites More sharing options...
Unholy Prayer Posted March 6, 2007 Author Share Posted March 6, 2007 Ahh, thank you very much. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.