Trial period over

So far I’ve got a form that registers users and stamps the time(); they registered via a $time_added variable into mySQL. They also get an access_type_id assigned to them of 7. I’d like this access_type_id to be 7 for a total of 7 days (1 weeks time), then upon 7 days from registering, the user is then assigned an access_type_id of 1, and is sent to a page stating “your trial period is over.”

Is this possible, can someone help out, I’ve been struggling with this for some time. :beer:

$query = "SELECT max(access_priv_id) from registered_mem";
	$rs = mysql_query($query, $db_conn);
	$row = mysql_fetch_array($rs, MYSQL_NUM);
	$access_priv_id = $row[0] + 1;	
	$query = "INSERT INTO registered_mem (username, password, email, fname, lname, access_type_id, access_priv_id, date_added) VALUES 
	('".$required_vars['username']."','".$required_vars['pass1']."','".$required_vars['email']."','".$required_vars['firstname']."','".$required_vars['lastname']."',7, $access_priv_id, '$time_added')";	
	if(!mysql_query($query, $db_conn)){
		$error = true;
		$error_msg .= "<li>Database Error, Please come back and try to register at another time (1)</li><br>