PDA

View Full Version : Query to get last post pagetext? (vb 3.8)


Athens
03-09-2014, 03:01 AM
Hello,

I'm trying to retrieve the contents of a specific thread's last post so it can be displayed in a plugin I'm working on. From what I've been reading, it looks like the only is to JOIN the "thread" table with the "post" table in order to get both lastpostid (thread) and pagetext(post), but I haven't been able to make this work.

Anyone have the proper syntax to accomplish this?

Any help would be greatly appreciated!

kh99
03-09-2014, 12:57 PM
I think it should be something like:

SELECT pagetext FROM thread
LEFT JOIN post on post.postid = thread.lastpostid
WHERE thread.threadid = X