![]() |
Stupidly simple question
Given a threadid (and forumid, if it makes a difference), how can I get the contents of the first post in a thread?
|
$DB_site->query("SELECT * FROM post WHERE threadid = " . intval($threadid) . " ORDER BY dateline DESC LIMIT 1");
.. eh something like that |
in vb3 you are going to need to do this as no variables will be available in the global scope:
$DB_site->query("SELECT * FROM post WHERE threadid = " . intval($_REQUEST['threadid']) . " ORDER BY dateline DESC LIMIT 1"); |
Didn't quite work:
PHP Code:
|
After that query run:
echo $post[pagetext]; |
Actually you need to use query_first(), not query()...
|
Thanks, a combinations of those two suggestions fixed it :)
|
It has to be ASC, not DESC, BTW, it was returning the last post :)
|
Oh yeah, that too. You can remove the ASC really, it's not needed. :)
|
All times are GMT. The time now is 12:31 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:
|