saves info to db when search button is pressed