-2
I am working on a system in which I must register several data from a form in different tables using mysql. It works like this: The person makes a registration and in the same form requests a special service, I save his data normally and with his ID, which is generated by auto-increment, I save the request data [id, user_id, request,...]. If everything goes right, fine. But the point is, and if the order registration is wrong? Should I delete the user, give the error message and return to the register to register again? What’s the best way out of this?
I think you should consider what might go wrong and work so that the error doesn’t happen and direct the user to the missing point to get ok
– MagicHat
The ideal is that all this is in a transaction, so if you fail a rollback, nothing will be done. The second question is to investigate what caused the problem, so register in the logs as many details as possible, if using external services (Newrelic) use them also to investigate what happened. Once the error occurred normally the resend user does not resolve.
– Inkeliz