Hello again!
Long time since my last visit
well I have a new news system and a mysql table what i want to do is take the rows in the topic but not the answers to this topic so...
a
could be made if i'm not wrong but then it would only select the topic_id row...
What i want is that it takes care of not repeating a topic (to make sure it doesn't take the replies which have the same topic id) but select all the rows in that topic... something like
Aie... ok i was thinking that you needed to fetch more than one column: along with topic_id some other fields too...anyways since you needed just topic_id, i think the first query select distinct topic_id would have worked perfectly....About select * .. group by topic_id, if is working then it should be returning the same result set as did the select distinct one.
mmm it doesn't because with select * .. group by topic_id u select all and group them by topic_id but with distinct it only retreives the topic_id column not the rest of the info...
Well don't care, anyway i appreaciate you read the post and took the time to think in a solution.
Thx!
BB!
SELECT phpbb_posts.* FROM ( SELECT topic_id, MIN(post_id) AS min_post
FROM phpbb_posts
WHERE forum_id IN ($forum_id) GROUP BY topic_id ) AS m
INNER JOIN phpbb_posts
ON phpbb_posts.topic_id = m.topic_id
AND phpbb_posts.post_id = m.min_post
ORDER
BY phpbb_posts.topic_id DESC
LIMIT $offset, $newsperpage"