phpBB latest posts problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

phpBB latest posts problem

Post by Joe »

I was wondering how I could make my latest forum posts which is similar to the on on these forums show the last poster of the topic rather than the overall author. I am currently selecting from phpbb_topics and then querying the name from phpbb_users like this:

SELECT * FROM phpbb_topics AS topic, phpbb_users AS user WHERE topic.topic_poster=user.user_id ORDER BY topic_id DESC LIMIT 5

But is there any method to show the last poster like I asked. Its confusing to explain this but I will try as hard as I can.


All the best!


Joe 8)
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

DESC LIMIT 1?
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

I've never used phpBB before so i don't know any of the fields, but if there is a date field for when the latest post was posted you could try something like:

SELECT * FROM phpbb_topics ORDER BY date DESC LIMIT 1
Post Reply