Hi,
in a MYSQL-Database table 'users' I have stored data of users of a message board.
There is a user_lastlogon field and a user_posts field.
I want to delete all users, who have not logged on to the board for more than 6 month and have 0 posts.
So I tried a query like that:
DELETE FROM users WHERE now()-user_lastlogon>.... AND user_posts=0
But I've problems with the date's format.
The lastlogon is e.g. 1061834640 for 25.08.2003 20:04. So I cannot substract that from now() properly.
Can you help me out? (I'd like to use just a query not php or such stuff)
in a MYSQL-Database table 'users' I have stored data of users of a message board.
There is a user_lastlogon field and a user_posts field.
I want to delete all users, who have not logged on to the board for more than 6 month and have 0 posts.
So I tried a query like that:
DELETE FROM users WHERE now()-user_lastlogon>.... AND user_posts=0
But I've problems with the date's format.
The lastlogon is e.g. 1061834640 for 25.08.2003 20:04. So I cannot substract that from now() properly.
Can you help me out? (I'd like to use just a query not php or such stuff)