Messages looping from MySQL to MQTT

Hello,

I'm using MIT app inventor to publish data to MySQL database and from MySQL database to my MQTT broker. Everything is working fine but as soon as I send data from my phone, this data loops every second and never stops on MQTT Broker. What i'm creating is a smoke detector which will beep if it detects smoke, if i trigger off switch it will send it to MQTT Broker to turn it off, but it keeps telling MQTT Broker to turn it off, in case there is a fire next time, smoke detector will be shut down immediately because messages that get published are looping. What can I do to read only new data that comes to MySQL database once?

Please help

Use an rbe node to avoid duplicate messages.

Is it possible that the app keeps sending the data?

RBE node did the job, thank you!

I've made a button on the application to send data to mysql database, the data would be simple text "STOP" to MQTT Broker so it reads when to stop the alarm.