phpbb db SQL function

Permabanned
Joined
19 Apr 2006
Posts
2,333
Location
West Yorkshire
I am wanting to run an sql query on my phpbb's database to remove an users with < 1 post who has been registered for 2 weeks or more.

I think I can work it out, all except working out how long they have been registed.

Thankfully phpbb give obvious names to their fields so I foudn the "user_regdate" field, however the dates in those fields looke like "1100538647"

So how do I write an sql statement to remove all users who are registered for more than 2 weeks and have a 0 post count?

Anyone help an SQL n00b?
 
http://www.unixtimestamp.com/index.php
Just convert the date into a 'timestamp'. and then do your delete from that.

delete from users where postcount = 0 and user_regdate < 1163570400

But obviously before doing any mass delete you always do a select on your query FIRST (to check what you're about to delete is what you expected).
 
hehehe thanks KA!!! thats perfect!

I have done the select and all looks good.

I am now just taking a backup of the entire db, before running the command \o/
 
Back
Top Bottom