so how can I write the result to a database ?