PDA

View Full Version : Thread Data on Alternate vB Page


GuruXL
02-25-2004, 10:57 PM
How can I get Thread data from threads I make to show up on another vBulletin page, just the post and the thread title, how can I do that?

Please someone help me!

Andreas
02-25-2004, 11:11 PM
$thread = $DB_site->query_first("SELECT thread.*,post.* FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid=thread.firstpostid)
WHERE thread.threadid=$threadid");


Instead of thread.*,post.* you can restrict it to the fields you really need.
So if you only want Author, Title, Date and Text this would be


thread.postusername, tread.title, thread.dateline, post.pagetext

GuruXL
02-26-2004, 12:46 AM
I don't think it will work.

Andreas
02-26-2004, 12:49 AM
Hmm ... why not?

GuruXL
02-26-2004, 08:25 AM
Cause when I tried it I got a SQL error.

Andreas
02-26-2004, 08:37 AM
Can you post the error message?

Did you set $threadid before executing this code?