I am uploading Bio-Metric data to my MYSQL database table.I am using PHP Codeigniter. In here i have the IN-TIME and OUT-TIME of a employee. But the employee may login and go out for some work and again come back in. So what i want is to select his first login and his last logout from my database. Now i have a dump for all days of the month!
So how to fetch the first login of the employee and his last logout?
My Table is as below:
Now the EMP_ID is the user-id ,date_data is the date and entry contains his in or out information.
If The entry>100 its called intime and else it in logout
This is my Table Schema:
CREATE TABLE IF NOT EXISTS `daily_data2` ( `id` int(10) NOT NULL AUTO_INCREMENT, `emp_id` int(10) NOT NULL, `date_data` varchar(30) NOT NULL, `abc` varchar(10) NOT NULL, `def` varchar(10) NOT NULL, `entry` int(10) NOT NULL, `ghi` int(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3720 ; So how to filter the data and get only my first login and last logout? This is My DATA:
