![]() |
Duplicating the above won't work. You can look at the usertools.php file in the admincp to see how vbulletin deletes sent pms or all pms, which may help you get started.
It looks like a similar query will work, but all three are linked together. Code:
pm |
Got some help on another forum which got me this far:
Code:
<?php However, this doesn't work. I get Quote:
Code:
$a = $DB_site->query("SELECT COUNT(*) AS oldpms FROM vbpm WHERE pmtextid IN(SELECT pmtextid FROM vbpmtext WHERE dateline < $time)"); |
I believe the error is caused by the
Code:
$DB_site->query Try this: Code:
$a = $db->query_read("SELECT COUNT(*) AS oldpms FROM vbpm WHERE pmtextid IN(SELECT pmtextid FROM vbpmtext WHERE dateline < $time)"); |
Better.
Code:
<?php Quote:
|
That is odd. I tried running the first query manually setting a time so it was 1 pm that is in my inbox and outbox. The count on the internal query was 1 and the full select was 2. That is correct. I tried running that query in a .php file and $a was blank. I'm not sure what is missing, or why you would be getting Resource id #16.
I wonder if php versions make a difference here? |
No idea.
This is what's running on my server: Server Type Linux Web Server Apache v1.3.37 PHP 4.4.4 MySQL Version 4.1.21-standard |
How did you run the first query exactly? I get an SQL error...
|
I put in a value for $time to get it to run with no errors. I got that value by adding a line to print $time.
Code:
SELECT pmtextid FROM vbpmtext WHERE dateline < 1170202068 Code:
print $a[oldpms]; Code:
print $a; |
Here's the exact code I'm running right now. I changed the days to 25.
Quote:
|
if I use
Code:
print $a[oldpms]; If I use Code:
print $a; Addendum: OK - I just saw your post above. So we get the same thing. |
All times are GMT. The time now is 08:38 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:
|