![]() |
Last Post Minute Query
Logician, is there an easy way to pull out the last poster in your query for the last post minute hack? If I can do it through there, I can cut another query and have it give me the right result all at the same time. ;)
|
I believe if changing the query to this should help:
SELECT post.dateline AS lastpostminute, thread.threadid, user.username FROM post, thread LEFT JOIN user ON user.userid = post.userid WHERE thread.forumid = $forumid AND thread.threadid = post.threadid ORDER BY post.dateline DESC LIMIT 1 Then you can use variable $lastpostminDB[username] |
LOL I just did this about 5 minutes ago. Here is the code I used and it seems to work.
PHP Code:
Will this code work or am I just lucky right now and it will mess up later? ;) |
I say go with my code (if it is working, I didn't test it!). For some reason getting the username from thread/post tables sometimes not works. This is why I put the left join query in my code to get it from the user table.
|
Thank you, sir. I'll go test it now and report back. ;)
|
Ok, tested and got no errors. How do I call the userid for the link to the user's profile now? I have been trying everything and can't find anything to work. ;)
|
SELECT post.dateline AS lastpostminute, thread.threadid, user.username, user.userid
FROM post, thread LEFT JOIN user ON user.userid = post.userid WHERE thread.forumid = $forumid AND thread.threadid = post.threadid ORDER BY post.dateline DESC LIMIT 1 |
Thank you, again, sir. I guess I still don't have the hang of these queries, yet. ;)
|
All times are GMT. The time now is 09:08 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|