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

Already multiple quides are there