ShoeLace1291 Posted April 10, 2007 Share Posted April 10, 2007 I'm making a forum software and I was wondering what the best method to make the new posts forum marker feature was. I just want to display an image next to the listed forum and if there haven't been any new posts since the user last visited the forum, it displays a certain image. If there has been new posts made since the user last visited the forum, it displays a different image. How would I use the database to do this? Quote Link to comment Share on other sites More sharing options...
Eric_Ryk Posted April 10, 2007 Share Posted April 10, 2007 Assuming $last_login is the user's last login: SELECT COUNT(*) AS new FROM topics WHERE created > $last_login AND forum = $id; Then on the basis of PHP's if rules (anything but 0 is true) you can just do an if($result) Quote Link to comment Share on other sites More sharing options...
ShoeLace1291 Posted April 11, 2007 Author Share Posted April 11, 2007 Will this work if last login is a varchar field in the database? To determine the last login, I just had a hidden input field with the value of the day's date and the server time with strings. 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.