The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#42
|
||||
|
||||
this is an answer i got from vb.com
hope it helps |
#43
|
|||
|
|||
Thanks, stinger, but it looks like they are deleting everything in the tables with those.
|
#44
|
|||
|
|||
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"); |
#45
|
|||
|
|||
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. |
#46
|
|||
|
|||
It would be this:
Code:
<?php require ("global.php"); $time = time() - (25 * 24 * 60 * 60); $a = $db->query("DELETE * FROM vbpmtext, vbpm, vbpmreceipt WHERE (vbpm.pmid = vbpmreceipt.pmid) AND (vbpm.pmtextid = vbpmtext.pmtextid)AND vbpmtext.dateline < $time"); ?> |
#47
|
|||
|
|||
It didn't work. Here's my adjusted code and the results I got from it:
Code:
<?php require ("global.php"); $time = time() - (27 * 24 * 60 * 60); $a = $db->query("DELETE * FROM vbul_pmtext, vbul_pm, vbul_pmreceipt WHERE (vbul_pm.pmid = vbul_pmreceipt.pmid) AND (vbul_pm.pmtextid = vbul_pmtext.pmtextid)AND vbul_pmtext.dateline < $time"); ?> Code:
Database error in vBulletin 3.6.4: Invalid SQL: DELETE * FROM vbul_pmtext, vbul_pm, vbul_pmreceipt WHERE (vbul_pm.pmid = vbul_pmreceipt.pmid) AND (vbul_pm.pmtextid = vbul_pmtext.pmtextid)AND vbul_pmtext.dateline < 1170411524; MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* FROM vbul_pmtext, vbul_pm, vbul_pmreceipt WHERE (vbul_pm.pmid = vbul_pmreceipt' at line 1 Error Number : 1064 Date : Tuesday, February 27th 2007 @ 04:18:44 AM |
#48
|
|||
|
|||
Try this one:
Code:
<?php require ("global.php"); $time = time() - (27 * 24 * 60 * 60); $a = $db->query("DELETE vbpmtext . * , vbpm . * , vbpmreceipt . * FROM vbpmtext, vbpm, vbpmreceipt WHERE (vbpm.pmid = vbpmreceipt.pmid) AND (vbpm.pmtextid = vbpmtext.pmtextid) AND vbpmtext.dateline < $time"); ?> |
#49
|
|||
|
|||
Well, it's a step closer. The code did not produce any errors, but it also did not delete anything.
|
#50
|
|||
|
|||
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 require ("global.php"); $time = time() - (27 * 24 * 60 * 60); $a = $db->query("DELETE vbpmtext . * , vbpm . * FROM vbpmtext, vbpm WHERE (vbpm.pmtextid = vbpmtext.pmtextid) AND vbpmtext.dateline < $time"); ?> |
#51
|
|||
|
|||
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 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|