So where is the code for add_to_database?
That probably means you have the wrong number or type of arguments when calling that function, but without seeing the code for it I can't possibly tell.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.