Hi All,
Just come across a very frustating problem regarding timestamps in MySQL.
What I am trying to do is to create a timesheet program where I click to enter the start time into the database and click again to enter the end time, this is the code I am using:
When I click start:
$sql = "INSERT INTO time VALUES('','$jobslist','','$rate','$title','$desc',CURRENT_TIMESTAMP(),'','$chargable')";
When I click stop:
$sql = "UPDATE time SET time_desc = '$desc', time_finish = CURRENT_TIMESTAMP() WHERE time_id = '$time_id'";
What is happening is that when I click stop the starting timestamp is being reset to the value of the stop timestamp?? which obviously doesn't give me any time difference at all!!!
Anyone got any ideas why this might be happening?
TIA
Mike