db write some code