if connection fails
insert values into database
retrieve and echo results