writing data to mySql