Ik wil de laatste post uit mijn forum halen, maar dan niet uit het deel wat alleen voor moderators is. Ik heb hiervoor deze query maar hij werkt niet. Hij geeft aan dat hij meer regels heeft in de subquery, kan iemand mij hiermee helpen?

SELECT topic_id,topic_title,forum_id
FROM phpbb_topics
WHERE (SELECT cat_id
FROM phpbb_forums where forum_id = forum_id )
!= '3'
;

Wat ik wil is dus dat hij de nieuwe posts selecteerd uit phpbb_topics waar cat_id uit phpbb_forums niet 3 is...

Alvast bedankt
Kan je niet beter een simpele join maken?
Ik wordt er niet helemaal wijs uit, wat verbind de tabellen phpbb_forums en phpbb_toppics?
SELECT t.topic_id, t.topic_title, t.forum_id
FROM phpbb_topics AS t, phpbb_forums AS f
WHERE t.forum_id = f.id
AND t.cat_id != 3
ORDER BY datumtijd_post

Die datumtijd_post moet je ff zelf invullen.

Reageren