Adding to database function

Added the function to add to the database (Still needs completing)