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? Link to comment https://forums.phpfreaks.com/topic/41520-views-of-a-page/ 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. Link to comment https://forums.phpfreaks.com/topic/41520-views-of-a-page/#findComment-201138 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... Link to comment https://forums.phpfreaks.com/topic/41520-views-of-a-page/#findComment-201139 Share on other sites More sharing options...
Unholy Prayer Posted March 6, 2007 Author Share Posted March 6, 2007 Ahh, thank you very much. Link to comment https://forums.phpfreaks.com/topic/41520-views-of-a-page/#findComment-201164 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.