Hi, I need to build a piece of code do calculate the total working time of a employee. I have the tables:
# # Table structure for table 'card_ticks' # CREATE TABLE card_ticks ( cod bigint(20) unsigned NOT NULL auto_increment, tick datetime , employee int(10) unsigned NOT NULL DEFAULT '0' , PRIMARY KEY (Cod) ); # # Table structure for table 'employes' # CREATE TABLE employes ( cod int(3) unsigned NOT NULL auto_increment, nameme char(30) NOT NULL DEFAULT '' , pass char(50) NOT NULL DEFAULT '' , PRIMARY KEY (cod) ); The table card_ticks is "feeded" by a system connected to a serial port where each time the employee pass a card into a machine a record is inserted on the table. Generally, a employee has 4 card_tick's by day, for example 1,2002-04-02 23:51:48,3 2,2002-04-02 23:52:00,7 3,2002-04-02 23:52:09,5 4,2002-04-02 23:52:14,3 5,2002-04-02 23:52:23,8 6,2002-04-02 23:52:32,1 7,2002-04-02 23:52:40,3 8,2002-04-03 00:04:39,3 9,2002-04-03 00:08:45,3 10,2002-04-03 00:11:23,3 11,2002-04-03 00:20:26,3 I have to write the code to do something like this Calculate the total working time in a month for employee 3. Any sugestions? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php