I have a db with the following tables
user(id, name....)
restaurant(id, name...)
module (id, name )
status_messages(id, pid, message, module_id, ModuleID)
Module Refers to either Users or Restaurant.
Both Users and Restaurants can have status_messages.
When a user (id=21) sets a status message
(1, 1, 'Message', 1, 21)
When a Restaurant (id=3) sets a status message
(2,2, 'Message', 2, 3)
pid = is the self id or parent id for the replies.
Which is the best way to pull out the status message and its replies of a user or a restaurant and display it.
Will i be able to pull it out?