0

I have developed 2 Database using MySQL and PHP.
I have created member table in which there is a type of user.
On basis of type I restricted user to view private pages.
Now I wanted to check status of users. when they login, logout means timing of the users.

2
Contributors
19
Replies
22
Views
7 Years
Discussion Span
Last Post by ayesha789
0

I have also know I have to create table in DB in which I have to update at every login and logout for getting my requirement. but I need innovative and easy idea.

0

alright, I didn't understand from your first post, sorry

I guess a good way is making a table for all the login entries, where you put the id of the user and the time of login, I guess this is the easiet way.

same thing for logout, in a seprate table.

0

I have a member table...
So u means , I have to create Login and Logout Table in DB which stores login and logout time?

0

basically only the id of the user and the time of login, that is all you need.

But maybe you want to divide the time to columns, like year,month,day,hour,minute... it's up to you

0
--
-- Table structure for table `members`
--

CREATE TABLE IF NOT EXISTS `members` (
  `MemId` int(5) NOT NULL AUTO_INCREMENT,
  `UserName` varchar(25) NOT NULL,
  `Password` varchar(20) NOT NULL,
  `Type` varchar(20) NOT NULL,
  PRIMARY KEY (`MemId`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=52 ;

its a table for members, now login and logout table, I only require MemId?

0
--
-- Table structure for table `login`
--

CREATE TABLE IF NOT EXISTS `login` (
  `MemId` int(5) NOT NULL AUTO_INCREMENT,
  `UserName` varchar(25) NOT NULL,
  `Type` varchar(20) NOT NULL,
  'Time' time  NOT NULL,
  'Date' date NOT NULL,
  PRIMARY KEY (`MemId`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=52 ;

This is my table structure.
Whenever user sign in I check his/her username from members table and on login success I redirect users to private pages on basis of type. Now how I insert record when user sign in.

0

as I said you need to make a new table.. columns: user_id Login_time...

when the user logs in you add a new entry in this table (the entry will consist of his id and the time of login)... as simple as that!

0

I have to pages when user sign in .
1. checklogin.php
2 loginsuccess
checklogin.php checks the username and password in Db and redirect it to loginsuccess.php after authentication. on which page i have to put query?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.