The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Does this mysql code work for deleting people's PMs if they have only 1 PM?
been making this code and I admit that I am very new to mysql, so it might not make sense.
I haven't dared to try it out. PHP Code:
|
#2
|
|||
|
|||
Well, never tried to work with PMs and stuff.
But suggestions to how i would make it, i would check the registration date - and check the message in PM date - and if 1. there for if the user have new message from another user, and he only have 1 pm, it wont delete it everytime. |
#3
|
|||
|
|||
It is notable that in MySQL v4.0 and on, TRUNCATE TABLE drops ALL ROWS, and does not take a WHERE clause. You also need to execute the queries and return the rows before using the results in another query. Even then, you are going to need to use explode to put them into a comma delimited string that you can use in the WHERE clause with IN. The easiest thing to do would probably be to execute a query to get all of the PMs you want to delete and then iterate through them and delete them using the PM datamanager. If you do it manually, you need to: 1) update the user table with the new post count, 2) delete the references in PM, and 3) delete the pm text from the pmtext table, BUT only if no other pm is referencing the same textid.
|
#4
|
||||
|
||||
Quote:
|
#5
|
||||
|
||||
And the ' . 's aren't needed.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|