Results 1 to 6 of 6
Feb 14, 2011, 10:52 #1
- Join Date
- Jul 2006
- 0 Post(s)
- 0 Thread(s)
displaying members that has log in on my site
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:
CREATE TABLE IF NOT EXISTS `whoisonline` (
`recordid` int(11) NOT NULL AUTO_INCREMENT,
`memberid` int(11) NOT NULL,
`lastlogin` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`loggedfromip` varchar(255) NOT NULL,
PRIMARY KEY (`recordid`),
KEY `memberidwho` (`memberid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
$lastlogin = time();
$query1 = "INSERT INTO whoisonline VALUES (NULL,'$memberid', '$lastlogin', '$loggedfromip')";
Can anyone help me to solve this?
Thanks in advance,