Here is what I am trying to do: I am creating a clockin/out utility with php and mysql. I need to do some error checking and look at the last record of the current employee to make sure it is a completed transaction. In other words, I want to make sure that before I clock someone in, that they successfully clocked out the day before. I think I need to stick a subselect inside an if/then statement. Something like: Table definition: id, employee, timein, timeout when client tries to clock in: <? //find out of the person forgot to clock out yesterday if((timeoutof last record of table where employee=$employee_id) = 0) { //clock them in //send me a message email($myemailaddress, $subject, $body); } //clock them in mysql_query("Insert into time values(NULL, $employee_id, unix_timestamp(), 0)"); ?> I can't figure out how to find out that condition in my if statement Sincerely, Clay Stuckey - MIS, MCSE Charleston Housing Authority (843) 224-9141
--------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php