php_guest Posted February 4, 2009 Share Posted February 4, 2009 Please help me if you have any idea how would you solve the following problem: I want to display to user on home page a notification when a friend of user changes profile. Changes can be new video, new photo, new comment. In each notification will be an information about who did change, what kind of change he/she did and time. I was thinking to put all changes into new table (columns: ID, userID, changeTitle, time) but I don't know how to display only new updates (which weren't displayed in user home page yet), not all of them. Thank you Link to comment https://forums.phpfreaks.com/topic/143821-how-to-display-only-new-updates-new-user-photo-new-comment/ Share on other sites More sharing options...
php_guest Posted February 4, 2009 Author Share Posted February 4, 2009 I found out that I can do this with storing data of previous login and current login together with storing time when the new photo, video, ... were posted. Now I just don't know how to delete all older rows older than previous one, not older than current one. So I need to keep current time and previous one until user log in again. Hope anybody can help me Link to comment https://forums.phpfreaks.com/topic/143821-how-to-display-only-new-updates-new-user-photo-new-comment/#findComment-754769 Share on other sites More sharing options...
gevans Posted February 4, 2009 Share Posted February 4, 2009 Why not store the time with every update and always display the last 10 (or however many) updates Link to comment https://forums.phpfreaks.com/topic/143821-how-to-display-only-new-updates-new-user-photo-new-comment/#findComment-754778 Share on other sites More sharing options...
php_guest Posted February 5, 2009 Author Share Posted February 5, 2009 this is also a good idea. Is in mysql the option to print last 10 rows? Link to comment https://forums.phpfreaks.com/topic/143821-how-to-display-only-new-updates-new-user-photo-new-comment/#findComment-754903 Share on other sites More sharing options...
gevans Posted February 5, 2009 Share Posted February 5, 2009 example query SELECT `field` FROM `table` ORDER BY `time` DESC LIMIT 10 Link to comment https://forums.phpfreaks.com/topic/143821-how-to-display-only-new-updates-new-user-photo-new-comment/#findComment-754910 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.