![]() |
Forumhome attachment query
Hello,
I want to do a query in a plugin on the forumhome that is rather difficult for me to do. I want to query the latest submitted attachment of 4 different forums (one attachment for each forum). I had a look at the attachment database table, but there is of course no info in which forum the attachment was posted. So the query would probably consist of several joins (qeurying the latest thread of a forum and then querying the latest attachment of that forum). Can anybody help, please? :o |
How do I query the latest attachment in a certain forum, please?
|
Bump. I'm still looking for a way to do this.
--------------- Added [DATE]1228043619[/DATE] at [TIME]1228043619[/TIME] --------------- I guess the way to do this is find out the latest thread in a forum and then query the first attachment in this thread. Should not be impossible. The forumhome shows info about the latest thread already... |
I'm also looking for a way to do this.
|
Maybe something like this:
Code:
"SELECT attachmentid FROM " . TABLE_PREFIX . "attachment AS attachment which finds attachment ids from forums 1, 2, or 3, newest ones first. I'm really just an SQL beginner so I don't know how you would do what the OP wants in one query. I suppose you could query all the attachments and read them until you find one from each forum, but i don't know how you'd do a query to return exactly one from each forum. |
All times are GMT. The time now is 03:24 PM. |
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:
|