How do you retrieve data from mysql database and set the status value in app switch button?

I have free web host with mysql database. I have one table of that database which has 3 fields.

id ----device_name----status
1------LED Light---------1
2------FAN----------------0
I want if mysql db table status field is "1" where id is 1 then set the switch status on and if the status field "0" then set the switch status off.

How can i do that?

Use query method

Use web url

Put your query in web url and try to catch the output in web. Got text. From the result, use if else condition to set whether the switch on or off

I am new in this MIT app inventor development. Can you create a demo project for me it will very helpful for me.

Already multiple quides are there

Thank you for your reply. I will try your project tomorrow and report you. Thank you very much.

1 Like

Also you can check this too