W
W
winzux2015-10-25 06:17:27
MySQL
winzux, 2015-10-25 06:17:27

How to freeze field value in mysql db table?

Hello.
For example, there is a table "users", in it the field "access". The value in the field is "3", which is updated several times per second by the server. It is necessary to freeze this field with the value "0", so that when creating a new user and updating old ones, it remains with "0".
Triggers are not an option, they load the base, and a delay of even 30ms is unacceptable on this project.
What other options are there?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Ruslan Fedoseev, 2015-10-25
@martin74ua

prevent the user under which the application is running from changing this field. Set another user field to the desired value. Get an error when trying to change a field. If the application spit on an error, then everything will work out. If not, tell the boss / customer that this is not possible and solve the problem humanly

P
Puma Thailand, 2015-10-25
@opium

Hardcode in code

O
Optimus, 2015-10-25
Pyan @marrk2

Nonsense is some kind of incorrect application architecture on the face and an attempt to make a crutch, in the user registration code, instead of querying the database, do $access = 0; )))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question