Updated mySQL flow