Insert chat into database