I have two rows in a table called membership.
one is called login, the other is called suspended.
Membership looks like so:
CREATE TABLE login (
id int(11) NOT NULL auto_increment,
username varchar(250) NOT NULL default '',
password varchar(250) NOT NULL default '',
email varchar(250) NOT NULL default '',
fname varchar(250) NOT NULL default '',
sname varchar(250) NOT NULL default '',
country text NOT NULL,
interests text NOT NULL,
age text NOT NULL,
iam text NOT NULL,
gender text NOT NULL,
school text NOT NULL,
status text NOT NULL,
aboutu text NOT NULL,
whyjoin text NOT NULL,
hobbies text NOT NULL,
memberstatus varchar(10) NOT NULL default 'Member',
userpic varchar(255) NOT NULL default '',
userpicalt varchar(255) NOT NULL default '',
warned varchar(18) NOT NULL default 'No - Zero of Three',
new varchar(8) NOT NULL default 'Yes',
newsletter char(3) NOT NULL default 'Yes',
lastlogin_date varchar(100) NOT NULL default '??-??-??',
lastlogin_time varchar(100) NOT NULL default '??:??:??',
account_active char(3) NOT NULL default 'No',
welcomemsg char(3) NOT NULL default 'Yes',
PRIMARY KEY (id),
FULLTEXT KEY country (country)
) TYPE=MyISAM PACK_KEYS=0 AUTO_INCREMENT=9875760;
the suspended row looks like so:
CREATE TABLE suspended (
id int(11) NOT NULL auto_increment,
username text NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM AUTO_INCREMENT=1;
This is my question. I am going to put another column in the login table called reg_date. reg_date is going to show the DATE they registered.
What I am looking to do is this:
When a user registers, the login table within membership is populated with their information. (which works.)
If a user has not logged into their account within a specified time, lets say 30 days from the date they registered, then I would like to have a script that will automatically send the usernames concerned (when executed) into the suspended database (populate -- without deleting the information within the login database).
I am still very new to PHP/MySQL and would like to know how this can be done.
Please advise if you can.