How to Use Mysql

How to use Mysql Databse As A realtime database like firebase when i update value in database instant update value in app how to do this in kodular :thinking:

Use This

How do you want to use mysq l?
Give us an example.


Im using mysql to get live chances

I don’t know what that is. But the number is decremented and the new value is shown on the screen as a result of a Select where iduser = some number. Is this number only decreased when the user clicks that button?

Yes when click button then insert value changes-1

1 Like

Update yourtable set atempts = atempts-1 Where iduser = 88996
88996 is a id user app

I think you don’t understand im telling about like firebase like when data changed block when value change in firebase then also update value in app like this how to do this with MySQL

First an update command, as I showed above.
Then a Select atempts from yourtable where … command to bring the new atempts value.
Select …Where iduser = numberiduseryourapp

After the update, the atempts field will be decremented. Check if the update did the right thing (response code) and then select Select atempts from yourtable to bring the value of the atemp field to show in your app.

1 Like

“Where iduser =” it means that you want to execute a command (Update , Select )and you want that command to be executed on the table lines that have the contents of the iduser = field at the value that your app will send. User Rogerio, iduser = 0075 then this value will be sent to execute the SQL command with filter.

In firebase there is an event that is always active and detects changes in the firebase values.

In MySql there is no such thing. You would have to do something that checks that value every certain amount of time (with a clock component, for example) to see if that value has changed.

MySql is not a real time database…