Add logic to insert into MySQL