I am creating a web application based on attendance system. I am using MySQL and PHP. I have a table for every employee that has took attendance and they keep adding when the employees takes attendance on the machine. I extracted the employees that has has attendance 2 times per day which are in and out, and I added them to a table with columns. Now I want to extract the attendances for the employees that has took attendance 1 per day or more than 2 per day which they are error and i want to add them to a table employee time1
, time2
and time3
.
I have a table as this design, it's an attendance system,
I need to split the time if the attendance count per day was not equal to 2, which are error logs.
id pd time date
1 5 07:05 08/07/2014
2 4 18:02 07/07/2014
3 1 07:05 06/07/2014
4 1 07:06 06/07/2014
5 1 18:00 06/07/2014
I need to add them to a table in the database and to be split in that form with respect the pd
and date
.
id pd time1 time2 time3 .... date
1 5 07:05 08/07/2014
2 4 18:02 07/07/2014
3 1 07:05 07:06 18:00 06/07/2014
sorry guys its my first post in my whole entire life , so forgive me if am doing something wrong or not complete
sample data
,expected result
anddbms type
. Thank you. It will be easier next time. – Used_By_Already Aug 15 '14 at 7:24