Dotaz MySQL UNION by mohl fungovat zde:
(SELECT `user_id`, `date_added`, 'photo' AS `type` FROM `photos` WHERE `user_id` = uid) UNION
(SELECT `user_id`, `date_added`, 'video' AS `type` FROM `videos` WHERE `user_id` = uid) UNION
(SELECT `user_id`, `date_added`, 'comment' AS `type` FROM `comments` WHERE `user_id` = uid)
ORDER BY `date_added` DESC;
Pak byste skončili se sadou výsledků jako
user_id | date_added | type
5 | 2009-01-03 | photo
5 | 2008-12-07 | video
5 | 2008-11-19 | comment
a tak dále. (ve skutečnosti můžete nechat user_id
z SELECT, pokud chcete, samozřejmě)