The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Need help with an SQL Query!
I need an SQL query or PHP script that will delete attachments from a certain forum. So far the only thing I can somewhat come up with is this query that I slapped together which if MySQL could understand what I was saying then it would work just fine However I must translate this into MySQL's language as obviously it doesn't work as it sits!
SELECT * FROM `thread` WHERE `forumid` = '25' AS t1 SELECT * FROM `t1`,`post` WHERE `post.postid` = `t1.postid` AS t2 SELECT * FROM `t2`,`attachment` WHERE `attachment.postid` = `t2.postid` So in the first line I wanna select all rows from the `thread` table WHERE the column `forumid` is = to 25 and then ALIAS this as t1 The second line SELECT all rows FROM `t1` (which we just created with line 1) and all rows from `post` WHERE `post.postid` = `t1,postid` and ALIAS this as t2 The third line SELECT all rows FROM `t2` (which we just created with line 2) and also SELECT all rows from `post` WHERE `attachment.postid` = `t2.postid` This should now give me my final list of all the attachments that are in posted in forumid 25 Hope this all makes sense. If you have a better solution which I'm sure you will then that's fine. When it comes down to it all I need to do is DELETE all the attachments that are in a particular forum. This is the somewhat only way I can think to do it. Any ideas? |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|