SELECT t.*, f.* from phpbb3_topics t, phpbb3_forums f where t.topic_id = 10123 and t.forum_id = f.forum_id