Not getting updated data back to my database

Sir, i have deployed mqtt rfid node where i am giving rfid number if its valid it shows CR_SUCCESS otherwise CR_FAIL .Now i have a door controller which has 2 switch open and close i want whenever anyone comes with valid id only that column gets updated in my database . How to do that ?
Thank You

Please stick to the thread we are already discussing this on.