functioning database with edit and delete function