After I upgrade from UBBT6 to UBBT7 , My (administrator) PM box is full of 'Welcome' message which are automatically sent to users. This cause my PM's box has 2200+ pages (20 message / page).
I want to delete all of these PMs with the same Subject 'Welcome' . What SQL command should I write ?
mysql> select count(*) from ubbt_PRIVATE_MESSAGE_TOPICS where TOPIC_SUBJECT = 'Welcome';
+----------+
| count(*) |
+----------+
| 31330 |
+----------+
1 row in set (0.17 sec)
_________________________ English is not my native language. I try my best to express my thought precisely. I hope you understand what I mean. If any misunderstanding results from culture gaps , I apologize first.
#171342 - 12/27/0611:50 PMRe: Delete all PMs with 'Welcome' Subject
[Re: smallufo]
Gizmo
Registered: 06/04/06
Posts: 11702
Loc: Portland, OR; USA
as the pm users table contains only topic id's it's impossible to cleanly purge everything with sql commands; however I have built a php script (free, cas I'm nice like that) which is capable of doing just this. You can get it at UBBDevhere.
Thank you . It helps me a lot , cleaning thousands of welcome messages ...
_________________________ English is not my native language. I try my best to express my thought precisely. I hope you understand what I mean. If any misunderstanding results from culture gaps , I apologize first.
#171344 - 12/28/0601:03 AMRe: Delete all PMs with 'Welcome' Subject
[Re: smallufo]
Gizmo
Registered: 06/04/06
Posts: 11702
Loc: Portland, OR; USA
Not a problem; a lot of people had the same issues, figured something had to be done ;)...
One thing I'm thinking about is cleaning up non-existant pm's which are shown in the users table; as some people just purged the other two and left that one unaffected (granted, I provided the query to do it, so I feel semi responsible). But I haven't done much work on that one yet (though as I have the issue on my main forum, it will eventually be done); this one was just for the community to assist all imported users (as I'm sure other products will have similar issues as well , should they have welcome messages)
#171395 - 12/28/0603:04 PMRe: Delete all PMs with 'Welcome' Subject
[Re: ntdoc]
Gizmo
Registered: 06/04/06
Posts: 11702
Loc: Portland, OR; USA
Simple, the PM_Users table only has a number to identify which pm's are which pm's; there is no content to identify which is a "welcome". You could take the id from the other tables, but if you're doing a broad delete with an sql statement, i highly doubt in your ability to log every private topic id to be able to purge them from the database.
The php script opens the private topic table, grabs the id, and purges that id in all 3 tables at once, then continues; all done on its own, and messages purged from all 3 tables.
Simply put, you can't search "welcome" in the _users table as all it contains is numbers.