Very good friends I wanted to know if you can help me with an idea to solve a question.
I would like to calculate the interests that a client has every certain amount of time (24 hrs for example).
I have the idea of doing a Timer Out Global, and when the clock reaches 0, make an UPDATE to all the clients that are in my database.
CREATE TABLE ahorro(
ahorro_id int not null PRIMARY key AUTO_INCREMENT,
user_id int not null,
user_uid int not null,
capital_real float(11,2) not null,
monto float(11,2) not null,
interes_recibidos float(11,2) not null,
capital_total float(11,2) not null,
hist_date datetime not null default CURRENT_TIMESTAMP
);
where:
amount: It is the amount that the client will enter.
capital_real: It is the sum of the amounts that the user has entered.
interes_recibidos: It is (capital_real * 15 * 1/36000).
capital_total: It is the summation (capital_real + interestreceived).
My question is if I can execute everything in a certain amount of time. and if it is possible, there is a way to update the columns (capital_real, interes_recibidos, capital_total) at the same time.
Greetings, thank you for your time.