![]() |
this is an answer i got from vb.com
hope it helps |
Thanks, stinger, but it looks like they are deleting everything in the tables with those.
|
Jacqueline, looking at it again, wouldn't this statement prune all three variables in one query? Could I just delete the first two and leave this?
Code:
$a = $db->query("DELETE * FROM vbpmtext, vbpm, vbpmreceipt WHERE (vbpm.pmid = vbpmreceipt.pmid) AND (vbpm.pmtextid = vbpmtext.pmtextid)AND vbpmtext.dateline < $time"); |
I think it will do it, but don't know for certain. Best bet is to backup your current forum and restore it to your testdb forum. Don't forget to pw protect the testvb directory. You can try the query out there, and if it doesn't work right, restore, then try again.
If that's not available, paste the exact code you want to try for the full .php file and I'll try it on the forum I'm building and see what happens. I only have a couple of PMs I've sent to myself, so its not as good a test as working with your own db, but definately better than nothing. |
It would be this:
Code:
<?php |
It didn't work. Here's my adjusted code and the results I got from it:
Code:
<?php Code:
Database error in vBulletin 3.6.4: |
Try this one:
Code:
<?php |
Well, it's a step closer. The code did not produce any errors, but it also did not delete anything.
|
Any chance it's the time value you used? Or the possibility that you have no PM receipts?
I really need to create a test forum, I think... But I'm also wondering about just omitting the PM receipts in the main query and adding a line to delete ALL of the receipts, which are far from critical. That would give us: Code:
<?php |
I verified the time value is good tonight. I do have a PM receipt. It is always a good idea to have a test forum, so I would do that anyway.
I took the query from the file and ran it in MySQL Query Browser and it did a partial. It actually got rid of the pm receipt, but it did not delete the rest. I'm looking at MySQL syntax right now. Here's the page if you want to take a look. http://dev.mysql.com/doc/refman/5.0/en/delete.html |
I'm going cross-eyed looking at this. I really think it needs a left join to get delete the pmreceipt and the pm records based on the date in pmtextid.
|
All times are GMT. The time now is 04:17 AM. |
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:
|