MySQL Forums
Forum List  »  PHP

Arbitrary update of fields - Strange ...
Posted by: Dr. Thomas W. Richter
Date: July 08, 2020 06:53AM


I have a very strange behavior with mysql and I can't explain it:
I created a time tracking program - part tablet / Android, the other part mysql and php.

To record the breaks, there is a startpause.php and a stoppause.php

If StartPause is pressed, a time stamp is set in the employee's master record to the pauseStart (datetime) field (NOW ()) and the status field to 1. If Stop PAUSE is pressed, the status field is calculated to 0 and for the minutes field the time between Stop and NOW () is calculated.

BUT: STOP PAUSE no longer sets the status to 0, because "at some point" the time stamp is no longer in the pauseStart field, but is set to NULL on its own!
And this is COMPLETELY strange:

When I start the break, it looks like this: see screenshot 2020-07-08 at 11.31.43

If I end the break now, that would also work, the status is set to 0.

SOMEWHERE, however, the pauseStart field is reset to NULL without us having changed anything. Just because. Now you can of course no longer calculate the pause time, but at the same time the status is no longer set to 0 even with PAUSE STOP! See screenshot 2020-07-08 at 11.41.07.

The time stamp remains in the test database, but not in the real database (perhaps because movements are taking place here)

Once more:
Overall, the whole project is quite manageable. But while everything remains with the test database without movement, it is set to NULL in the production database, in which breaks are started, stopped, times are entered, etc. Everything in test and production right away!

Maybe not mysql, but maybe a transaction side effect.

I am in despair ...


Options: ReplyQuote

Written By
Arbitrary update of fields - Strange ...
July 08, 2020 06:53AM

Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.