PTS Posted March 28, 2007 Share Posted March 28, 2007 I have two tables created in my database: "news" and "newsviewed" news is our news engine for posting stories to our site and newsviewed is a new table we created to track how many times a story is viewed so we can offer our visitors features like favorite stories, most viewed, etc. Each time a visitor loads a story on our site (/fullstory.php?newsid=####), I want to create a row in the newsviewed table that automatically inserts a row of data (id, newsid, timestamp). Is there a php statement that I can do to make this happen automatically each time a story is loaded? Any guidance or direction would be greatly appreciated. Also, is this an efficient way of doing this? I know I could add a field to the news table called counter and then update that field to go up by one but I want to have the ability to show most popular stories by date. Link to comment https://forums.phpfreaks.com/topic/44584-tracking-how-many-times-a-row-of-data-is-viewed/ Share on other sites More sharing options...
PTS Posted March 28, 2007 Author Share Posted March 28, 2007 nm this post. I figure out an additional question I had listed here. Link to comment https://forums.phpfreaks.com/topic/44584-tracking-how-many-times-a-row-of-data-is-viewed/#findComment-216559 Share on other sites More sharing options...
Recommended Posts