Update all rows

Hello everyone,

I was wondering if there was a way to update all rows in a database. I explain myself : I have a database with different columns, and one of the columns is for “temporary bonuses”. These bonuses must be set back to 0 everyday : how can I do that ?

For example, if I have a database like this :

Stat : Bonus :
Strength 4
Intelligence 3
Agility 6
Spirit 9

How can I set all rows to 0 ? Of course, I have more than 4 stats, so I have to find something effective…

Thanks by advance

такие настройки создаются на стороне сервера, какую бд Вы используете ?

Such settings are created on the server side, what database are you using?

It’s a local database, that’s why…

да, это не просто. сделал небольшой пример, возможно он Вам подойдет. В начале мы получаем дату из последнего входа БД, потом потом вычисляем значение timestamp. (если остаток больше или равен 86400, то прошли сутки или более). после чего сбрасываем значение энергии на ноль и создаем запись в БД с новой датой, но с там же временем.

yes, it’s not easy. I made a small example, maybe it will suit you. First, we get the date from the last database entry, then later we calculate the timestamp value. (if the balance is greater than or equal to 86400, then a day or more has passed). after which we reset the energy value to zero and create an entry in the database with a new date, but with the same time.

timestamp.flp (32.6 KB)


Back to Flipabit >
Copyright © 2018. Flipabit Team. All rights reserved.