Add functionality for updating ap table in MySQL database
Merge into dev