PDA

View Full Version : mass delete unconfirmed users?


carpman
August 20th, 2013, 06:47 AM
Hi, i would like to mass delete all unconfirmed users, this not easy in adminCP for large number of user so wish to do it by sql. I use a simular method with another script with following syntax:

$strSQL="DELETE FROM `PLD_USER` WHERE `EMAIL_CONFIRMED` = '0' AND `REGISTRATION_DATE` < (CURDATE() - INTERVAL 2 DAY);"

so tried

DELETE FROM `users` WHERE `usergroupid` = '3' AND `joindate` < (CURDATE() - INTERVAL 2 DAY)

which did not work?

any idea what correct syntax for photopost would be?

thanks

Chuck S
August 20th, 2013, 07:07 AM
Remember photopost user table is only used when it is a standalone product and does not operate the same way as maybe the forum your talking about.

There are no unconfirmed users if using the photopost registration system and the verify email setting is off.

Your query looks valid to me to delete any entries with an entry of 3 as the usergroupid where joindate is less than 2 days from now. You more than likely have no results that match that.

DELETE FROM `users` WHERE `usergroupid` = '3'

That will delete definately delete any user that has not confirmed there email but again only if your using that setting and we are talking about photopost as a standalone using its own registration.

carpman
August 20th, 2013, 07:10 AM
Thanks for reply, this is a stand alone install.

I tried

DELETE FROM `users` WHERE `usergroupid` = '3'

which works, but the user list in PP admin is not updated and when i click on a deleted users i get an sql error.

I have verify email setting on and when i do a user search in PP admin for group Unregistered i get very long list, these look like spammer registrations.

thanks

Chuck S
August 20th, 2013, 07:40 AM
Not really sure what your talking about the user list is not updated we do not cache data so try refreshing your pages etc before trying to display any list when doing some behind the scenes deletion.

You need to list the actual sql if you want me to comment.

carpman
August 20th, 2013, 07:43 AM
Not really sure what your talking about the user list is not updated we do not cache data so try refreshing your pages etc before trying to display any list when doing some behind the scenes deletion.

You need to list the actual sql if you want me to comment.

thanks for reply, yep needed a page refresh, have successfully deleted unregistered users :)

thanks

Chuck S
August 20th, 2013, 07:45 AM
yes just remember when doing things outside the normal parameters of the script to properly refresh things so you do not get any unwanted behavior.