Let's say I have a screenshots
table and a replies
table. So: every screenshot can have multiple replies (one-to-many). Now, I want to create a combined timeline of the two, but in reality, they're pretty unrelated (in structure).
How can I select data from both tables, ordering by their publish time, descending; when for example, I can have a post, a few comments, then another post; because that would be how the timeline happened?
Normally selecting from both combines the tables; but I don't want that to happen. On that subject, I also need the tables to be distinguishable. Here's the structure for the tables...
-- -- Table structure for table `screenshots` -- CREATE TABLE IF NOT EXISTS `screenshots` ( `id` int(11) NOT NULL auto_increment, `user` int(11) NOT NULL, `description` text NOT NULL, `time` timestamp NOT NULL default CURRENT_TIMESTAMP, `ext` varchar(4) NOT NULL default 'png', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ; -- -------------------------------------------------------- -- -- Table structure for table `screenshot_replies` -- CREATE TABLE IF NOT EXISTS `screenshot_replies` ( `id` int(11) NOT NULL auto_increment, `user` int(11) NOT NULL, `parent` int(11) NOT NULL, `time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `text` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=27 ;
Note: I realize this may be a duplicate of this question but I didn't find the solution there working for me.
Thanks in advance! :)