i have two fields in mysql database entry time ->type time stamp and exit time->type datetype.
entry time should be entered at fist submissin of form and exit time should be null..and when i update the table then the exit time fiels should be updated..but this is not happing..entry is ok but exit time is not being update ..any one can tell me the code to do it.

Recommended Answers

All 4 Replies

can you show your codes?

but I think this will help
UPDATE tbl_name SET end_time='values' WHERE id='values'

$exittime=getdate("y/m/d H:i:s");
$query2="UPDATE attendance SET exit_time=$exittime WHERE emp_id = '$empid'";

i have taken datetime type for exit_time field..but in the database there is nothing updating.

$exittime=getdate("y-m-d H:i:s");
$query2="UPDATE attendance SET exit_time='$exittime' WHERE emp_id = '$empid'";

use this command

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.