$sql = "SELECT photos.title, photos.id FROM photos UNION SELECT photos_alternates.title, photos_alternates.id FROM photos_alternates UNION SELECT comment, comments.id FROM comments ORDER BY photos.id DESC, photos_alternates.id DESC, comments.id DESC LIMIT 10";