1

Topic: Problem with mysql request ... (call topics on a page)

SELECT * FROM `punBB_forums` INNER JOIN punBB_topics ON ( punBB_forums.id = punBB_topics.forum_id ) WHERE forum_id = 5 and closed = 1 ORDER BY punBB_topics.id DESC LIMIT 0 ,10


Look at my forum http://www.sortons.net/forum/viewforum.php?id=5

As you can see, this forum has only 2 non closed topics ... but the result = the 10 last posts, even if I choose "CLOSED=1" ... where is the problem ?

2 (edited by zaher 2005-08-08 00:16)

Re: Problem with mysql request ... (call topics on a page)

What results you need to get?, your sql get the last 10 closed topic added to forum 5.

If your people come crazy, you will not need to your mind any more.

3

Re: Problem with mysql request ... (call topics on a page)

The problem is I put closed=1 ou closed=0, I have the same results ...

The results I want is "I want only the "open posts" ... in this case, even if I put a limit of 10 posts, I would like only to have the 2 actuals posts "non closed".

4

Re: Problem with mysql request ... (call topics on a page)

Try it im not test it tongue

SELECT * FROM `punBB_forums` 
INNER JOIN punBB_topics ON ( punBB_forums.id = punBB_topics.forum_id and punBB_topics.closed = 0) 
WHERE forum_id = 5 
ORDER BY punBB_topics.id DESC LIMIT 0 ,10
If your people come crazy, you will not need to your mind any more.

5

Re: Problem with mysql request ... (call topics on a page)

Thanx ! smile works like a charm smile

Another question (I begin ...) where include " AND punBB_topics.closed = 0 " inside extern.php ?

6

Re: Problem with mysql request ... (call topics on a page)

All is right !

http://www.sortons.net/cinema/

thanx smile