![]() |
I cannot see what is wrong. There must be some code syntax we are not aware of as the query works fine manually. I did see that perhaps quotes were missing around the array element, but that doesn't seem to make a difference. Here's what I've got that shows some of what I've tried to make this work.
Code:
<?php |
A hint on another forum got me closer.
Using this: Code:
<?php Quote:
|
It is normal that those two counts are different. The database is normalized, so the text of the PM only gets sent once, while the PM will have a count of 2, one for the inbox of receiver and one for the sentbox of the sender. The PMs would be exactly double if no one had deleted any, but with that many you'll have some where either the sender or receiver deleted, but not the other.
So the initial welcome PM on my system has this: PMID = 1, PMTextID=1,UserID=1,folderid=-1 PMID=2,PMTextID=1,UserID=1,folderid=0 The PM went from me to me, so the UserID is the same. One PM is in my sent items, and one is in my inbox, which must be what the folderid is referring to. They both have identical text, so they point to the same PMTextID. So that code looks fine. Now you need a query that will select and delete all the rows in vbpmreceipts where PMID = one of the PMIDs you are deleting. |
Thanks, Jacqueline.
I've been soliciting some help over at TAZ as well and member Sarah there has suggested this: Quote:
|
At first I tried these and they didn't work. Then I realized there were no read receipts on this forum yet, so I sent a message with one. The select count selected one. The delete I changed to a select and it selected the correct record, so it looks like she did a great job with the code for you.
|
Here's the latest:
Code:
<?php Quote:
This is the result using "query_first". If I just use "query", no data is printed (just the text). What exactly is the difference? |
Answering my own question, from https://vborg.vbsupport.ru/showthread.php?t=75207:
Quote:
Quote:
|
So:
If I understand this now, the following tells me how many PMs, PM Texts, and PM Receipts need to be deleted: Code:
<?php Code:
<?php And do I need "DELETE *" or just "DELETE"? |
I will take a look at this later tonight, but I just spotted that you've got the 25 days I was using instead of the 60 days you wanted in your time variable.
|
I took a quick look at the delete statements and it doesn't look right. The delete * is right, but I do not see any where you are deleting from vbpmreceipt. The order matters too. Probably vbpmreceipts need to be deleted first, then vbpm, then vbpmtext. Once you delete vbpmtext, you lose your date and cannot use it to delete the others.
|
All times are GMT. The time now is 02:53 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:
|