I have two different tables with different structures. When user does action A, a row gets inserted into table A in respect to the action, the same way for table B. When user does action B, a row gets inserted into table B.
Now I have a news feed that I want to show both these actions to other friends. How do I query both tables with different structure using MySQL, and then use PHP to construct update posts in a time sorted manner?
Just like in Facebook, A user update on his relationship status is different than a post he makes and attach a photo to it but they both appear in the same news feed although their structures and the type of data they carry is different. I appreciate if someone can shed some light on this and discuss a possible solution.