i m working on a notification system just like facebook has .
my database structure is
i have made type_id such as type of notification . [ wall comments, wall post ,etc]
the problem is how do i retrieve data from the notification like using timestamp i can get data in according to updated date or time but still after getting the type . how to match the type with the other tables needed to show outcome like random notification in facebook . can anyone help me out with the database query .
like for type
wall comment -- i have to retrieve data from the wall comment and notification table both
wall post -- i have to retrieve data from the wall post and notification table both
how to combine them according to the timestamp later on and get results according to like this
for example
rahul posted on your wall 2 hours ago
ritu commented on your post 1 hrs ago
can any one help??