I have a code to count student id who has "in" and "out" all I want is to get the student id who have "in" and "out",if the student have only "in" I want to execute this code
INSERT INTO
log
(stud_id
,date_log
,time_log
,ampm
,status_log
,status
) VALUES ('student id who has "in" only', 'currentdate', 'current time', 'PM', 'out', 1),
This is my existing code.
$total=mysql_query("SELECT count(stud_id) as mycount, stud_id, date_log FROM `log`
WHERE date_log >= CURRENT_DATE() and ampm='pm' GROUP BY stud_id");
$d=mysql_fetch_assoc($mycount);
</div>