complete code to insert inputed data to data base