Hi everyone

I have a website on which registered members can log in. I would like to be able to display the members that logged in on my website in last 15 minutes.
Many sites have this feature especially forums.

For that purpose, I have created the following table in my database:

PHP Code:
memberidint(11NOT NULL,
loggedfromipvarchar(255NOT NULL,
PRIMARY KEY (`recordid`),
KEY `memberidwho` (`memberid`)
On my validateMembers page (this is the page that verify that member can login) after the validation I have the following code:

PHP Code:
$lastlogin time();

$query1 "INSERT INTO whoisonline VALUES (NULL,'$memberid', '$lastlogin', '$loggedfromip')"
At this time, insert works, but in php my admin, the inserted record display "0000-00-00 00:00:00" in the field lastlogin. But that is not my only problem. I am wondering how I will make the select after, to check which members are logged in in the last 15 minutes.

Can anyone help me to solve this?

Thanks in advance,